Commit 9c49f106 authored by Jens Henrik  Goebbert's avatar Jens Henrik Goebbert

infoterm: vncperf, cpuquota, dataquota

parent d5d93a2b
../../data/applications/default-vncperf-infoterm.desktop
\ No newline at end of file
../../data/infoterm-dataquota-default/infoterm-dataquota-default.lua
\ No newline at end of file
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-htop-default") then
-- Removes all window decorations
undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
set_skip_pager(true)
-- set the current window below all normal windows
set_window_below(true)
-- sets the window type, according to _NET_WM_WINDOW_TYPE
set_window_type("WINDOW_TYPE_SPLASH")
end
../../data/infoterm-htop-default/infoterm-htop-default.lua
\ No newline at end of file
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-jobtime-default") then
-- Removes all window decorations
undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
set_skip_pager(true)
-- set the current window below all normal windows
set_window_below(true)
-- sets the window type, according to _NET_WM_WINDOW_TYPE
set_window_type("WINDOW_TYPE_SPLASH")
end
../../data/infoterm-jobtime-default/infoterm-jobtime-default.lua
\ No newline at end of file
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-motd-default") then
-- Removes all window decorations
-- undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
-- set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
-- set_skip_pager(true)
-- set the current window below all normal windows
-- set_window_below(true)
-- sets a window always on top
make_always_on_top()
-- centers the current window on the current workspace
center()
-- focuses the current window
-- focus_window() - this gives the error: "Wnck-WARNING **: Received a timestamp of 0; window activation may not function properly."
-- sets the window type, according to _NET_WM_WINDOW_TYPE
-- set_window_type("WINDOW_TYPE_SPLASH")
end
../../data/infoterm-motd-default/infoterm-motd-default.lua
\ No newline at end of file
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-wall-default") then
-- Removes all window decorations
-- undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
-- set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
-- set_skip_pager(true)
-- set the current window below all normal windows
-- set_window_below(true)
-- sets a window always on top
make_always_on_top()
-- centers the current window on the current workspace
center()
-- focuses the current window
-- focus_window() - this gives the error: "Wnck-WARNING **: Received a timestamp of 0; window activation may not function properly."
-- sets the window type, according to _NET_WM_WINDOW_TYPE
-- set_window_type("WINDOW_TYPE_SPLASH")
end
../../data/infoterm-wall-default/infoterm-wall-default.lua
\ No newline at end of file
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported - you must not use ${XDG_DATA_HOME} :(
XDG_DESKTOP_DIR="$HOME/.local/xdg_profiles/default/Desktop"
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=infoterm-cpuquota-default
Comment=
Exec=bash -c '${XDG_PROFILES_DIR}/default/data/infoterm-cpuquota-default/infoterm-cpuquota-default.sh'
Icon=/homeb/zam/goebbert/workspace/xdg_profiles/etc/xdg/profiles/default/data/icons/fzj-utils-infoterms-logo_32x32.png
StartupNotify=false
Terminal=false
Hidden=false
Categories=FZJ-Infoterms
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=infoterm-dataquota-default
Comment=
Exec=bash -c '${XDG_PROFILES_DIR}/default/data/infoterm-dataquota-default/infoterm-dataquota-default.sh'
Icon=/homeb/zam/goebbert/workspace/xdg_profiles/etc/xdg/profiles/default/data/icons/fzj-utils-infoterms-logo_32x32.png
StartupNotify=false
Terminal=false
Hidden=false
Categories=FZJ-Infoterms
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=infoterm-vncperf-default
Comment=
Exec=bash -c '${XDG_PROFILES_DIR}/default/data/infoterm-vncperf-default/infoterm-vncperf-default.sh'
Icon=/homeb/zam/goebbert/workspace/xdg_profiles/etc/xdg/profiles/default/data/icons/fzj-utils-infoterms-logo_32x32.png
StartupNotify=false
Terminal=false
Hidden=false
Categories=FZJ-Infoterms
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-cpuquota-default") then
-- Removes all window decorations
-- undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
-- set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
-- set_skip_pager(true)
-- set the current window below all normal windows
-- set_window_below(true)
-- sets a window always on top
make_always_on_top()
-- centers the current window on the current workspace
center()
-- focuses the current window
-- focus_window() - this gives the error: "Wnck-WARNING **: Received a timestamp of 0; window activation may not function properly."
-- sets the window type, according to _NET_WM_WINDOW_TYPE
-- set_window_type("WINDOW_TYPE_SPLASH")
end
#!/bin/bash
# set the XDG_CONFIG_HOME for infoterm to the directory infoterm.sh is stored
# and start terminal to show TMP_FILE
XDG_CONFIG_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" \
xfce4-terminal \
--disable-server \
--title=infoterm-cpuquota-default \
--hide-menubar \
--hide-toolbar \
-e 'sh -c "q_cpuquota; read -p \"Press [Enter] key to close...\""'
[Configuration]
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=80x40
MiscInheritGeometry=FALSE
MiscMenubarDefault=FALSE
MiscMouseAutohide=FALSE
MiscToolbarDefault=FALSE
MiscConfirmClose=FALSE
MiscCycleTabs=TRUE
MiscTabCloseButtons=TRUE
MiscTabCloseMiddleClick=TRUE
MiscTabPosition=GTK_POS_TOP
MiscHighlightUrls=TRUE
TitleInitial=infoterm-cpuquota-default
FontName=Monospace 11
ShortcutsNoMenukey=TRUE
ShortcutsNoMnemonics=TRUE
BackgroundMode=TERMINAL_BACKGROUND_TRANSPARENT
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-dataquota-default") then
-- Removes all window decorations
-- undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
-- set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
-- set_skip_pager(true)
-- set the current window below all normal windows
-- set_window_below(true)
-- sets a window always on top
make_always_on_top()
-- centers the current window on the current workspace
center()
-- focuses the current window
-- focus_window() - this gives the error: "Wnck-WARNING **: Received a timestamp of 0; window activation may not function properly."
-- sets the window type, according to _NET_WM_WINDOW_TYPE
-- set_window_type("WINDOW_TYPE_SPLASH")
end
#!/bin/bash
# set the XDG_CONFIG_HOME for infoterm to the directory infoterm.sh is stored
# and start terminal to show TMP_FILE
XDG_CONFIG_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" \
xfce4-terminal \
--disable-server \
--title=infoterm-cpuquota-default \
--hide-menubar \
--hide-toolbar \
-e 'sh -c "q_dataquota; read -p \"Press [Enter] key to close...\""'
[Configuration]
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=130x40
MiscInheritGeometry=FALSE
MiscMenubarDefault=FALSE
MiscMouseAutohide=FALSE
MiscToolbarDefault=FALSE
MiscConfirmClose=FALSE
MiscCycleTabs=TRUE
MiscTabCloseButtons=TRUE
MiscTabCloseMiddleClick=TRUE
MiscTabPosition=GTK_POS_TOP
MiscHighlightUrls=TRUE
TitleInitial=infoterm-dataquota-default
FontName=Monospace 11
ShortcutsNoMenukey=TRUE
ShortcutsNoMnemonics=TRUE
BackgroundMode=TERMINAL_BACKGROUND_TRANSPARENT
#!/bin/bash
# create tmp file
TMP_FILE=`mktemp`;
PROGNAME=$(basename $0)
echo "tmp = ${TMP_FILE}" > out.txt
function clean_up {
# Perform program exit housekeeping
# Optionally accepts an exit status
rm -f $TMP_FILE
exit $1
}
function error_exit {
# Display error message and exit
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
clean_up 1
}
trap clean_up SIGHUP SIGINT SIGTERM
if [ ! -f "$TMP_FILE" ]; then
error_exit "tmp file $1 cannot be read"
fi
PRINT_LINES=1
if [ ! -z "${SLURM_JOBID}" ]; then
while true; do
#echo "remaining time: " > ${TMP_FILE}
squeue -h -j ${SLURM_JOBID} -o %L > ${TMP_FILE}
clear
head -${PRINT_LINES} ${TMP_FILE} | xargs echo -n
sleep 1
done
else
VNCSERVER_PID=`ps -xa | grep Xvnc | grep "${VNCDESKTOP}" | awk '{print $1;}'`
while true; do
#echo "start time: " > ${TMP_FILE}
ps -p ${VNCSERVER_PID} -o etime= > ${TMP_FILE}
clear
head -${PRINT_LINES} ${TMP_FILE} | xargs echo -n
sleep 1
done
fi
clean_up
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-htop-default") then
-- Removes all window decorations
undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
set_skip_pager(true)
-- set the current window below all normal windows
set_window_below(true)
-- sets the window type, according to _NET_WM_WINDOW_TYPE
set_window_type("WINDOW_TYPE_SPLASH")
end
#!/bin/sh
#!/bin/bash
# settings
# position settings
#---------------------------------------
TERM_MARGIN_X_RIGHT=50
TERM_MARGIN_Y_TOP=250
TERM_MARGIN_Y_BOTTOM=300
TERM_CHAR_HEIGHT_PX=8
TERM_CHAR_WIDTH_PX=$(expr ${TERM_CHAR_HEIGHT_PX} / 2)
TERM_CHAR_WIDTH_PX=$(echo "${TERM_CHAR_HEIGHT_PX} / 2 +1" | bc)
#TERM_CHAR_WIDTH_PX=$(gs -dQUIET -sDEVICE=nullpage 2>/dev/null - <<< '8 /Monospace findfont exch scalefont setfont (A) stringwidth pop ==')
TERM_CHAR_HEIGHT_MARGIN=4
......@@ -24,26 +26,38 @@ echo " TERM_CHAR_HEIGHT_MARGIN = ${TERM_CHAR_HEIGHT_MARGIN}"
echo
# calc terminal geometry (size+position)
#---------------------------------------
# get screen resolution
SCR_RES_X=`xrandr | grep current | awk '{ for(i=1;i<=NF;i++) if ($i == "current") print $(i+1) }' | sed 's/[^0-9]*//g'`
SCR_RES_Y=`xrandr | grep current | awk '{ for(i=1;i<=NF;i++) if ($i == "current") print $(i+3) }' | sed 's/[^0-9]*//g'`
echo "screen resolution: ${SCR_RES_X} x ${SCR_RES_Y}"
# set terminal size (depending on screen resolution)
TERM_CHARS_X=120
TERM_CHARS_Y=16
#$(( (${SCR_RES_Y} - ${TERM_MARGIN_Y_TOP} - ${TERM_MARGIN_Y_BOTTOM}) / (${TERM_CHAR_HEIGHT_PX} + ${TERM_CHAR_HEIGHT_MARGIN}) ))
echo "terminal columns x rows: ${TERM_CHARS_X} x ${TERM_CHARS_Y}"
# set terminal position (depending on screen resolution)
INFOTERM_XPOS=$(( ${SCR_RES_X} - ${TERM_MARGIN_X_RIGHT} - ${TERM_CHARS_X} * ${TERM_CHAR_WIDTH_PX} ))
INFOTERM_YPOS=${TERM_MARGIN_Y_TOP}
echo "terminal pixel position: ${INFOTERM_XPOS} x ${INFOTERM_YPOS}"
# set terminal geometry
INFOTERM_GEOMETRY=${TERM_CHARS_X}x${TERM_CHARS_Y}+${INFOTERM_XPOS}+${INFOTERM_YPOS}
echo "geometry: ${INFOTERM_GEOMETRY}"
# set the XDG_CONFIG_HOME for infoterm to the directory infoterm.sh is stored
# and start terminal with forever-refresh-loop
# start terminal with script
# (set the XDG_CONFIG_HOME for infoterm to the directory infoterm.sh is stored and start terminal with script.sh)
#---------------------------------------
XDG_CONFIG_HOME=${INFOTERM_DIR} \
PRINT_LINES=${TERM_CHARS_Y} \
xfce4-terminal --disable-server --title=infoterm-htop-default --hide-menubar --hide-borders --hide-toolbar --geometry=${INFOTERM_GEOMETRY} \
-e 'sh -c "htop -C -u nobody --delay=50 --sort-key=PERCENT_CPU"'
xfce4-terminal \
--disable-server \
--title=infoterm-htop-default \
--hide-menubar \
--hide-borders \
--hide-toolbar \
--geometry=${INFOTERM_GEOMETRY} \
-e 'sh -c "htop -C -u nobody --delay=50 --sort-key=PERCENT_CPU"'
\ No newline at end of file
#!/bin/bash
function clean_up {
# Perform program exit housekeeping
# Optionally accepts an exit status
rm -f $TMP_FILE
exit $1
}
function error_exit {
# Display error message and exit
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
clean_up 1
}
# create tmp file
TMP_FILE=`mktemp`;
PROGNAME=$(basename $0)
trap clean_up SIGHUP SIGINT SIGTERM
if [ ! -f "$TMP_FILE" ]; then
error_exit "tmp file $1 cannot be read"
fi
PRINT_LINES=1
if [ ! -z "${SLURM_JOBID}" ]; then
while true; do
#echo "remaining time: " > ${TMP_FILE}
squeue -h -j ${SLURM_JOBID} -o %L > ${TMP_FILE}
clear
head -${PRINT_LINES} ${TMP_FILE} | xargs echo -n
sleep 1
done
else
VNCSERVER_PID=`ps -xa | grep Xvnc | grep "${VNCDESKTOP}" | awk '{print $1;}'`
while true; do
#echo "start time: " > ${TMP_FILE}
ps -p ${VNCSERVER_PID} -o etime= > ${TMP_FILE}
clear
head -${PRINT_LINES} ${TMP_FILE} | xargs echo -n
sleep 1
done
fi
clean_up
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
if (get_window_name()=="infoterm-jobtime-default") then
-- Removes all window decorations
undecorate_window()
-- asks the window manager to put the window on all workspaces
pin_window()
-- Asks the window manager to keep the window's position fixed on the screen,
-- even when the workspace or viewport scrolls.
stick_window()
-- set this to true if you would like the window to skip listing in your tasklist
set_skip_tasklist(true)
-- set this to true if you would like the window to skip listing in your pager
set_skip_pager(true)
-- set the current window below all normal windows
set_window_below(true)
-- sets the window type, according to _NET_WM_WINDOW_TYPE
set_window_type("WINDOW_TYPE_SPLASH")
end
#!/bin/sh
#!/bin/bash
# settings
# position settings
#---------------------------------------
TERM_MARGIN_X_RIGHT=0