# window manager module for grml-quickconfig
-LINE='print_line "Start ${HIGHLIGHT}x${NORMAL} (${HIGHLIGHT_NAME}grml-x${NORMAL})"'
+LINE='print_line "Start ^x (/grml-x/)"'
KEY=(x)
FUNCTION='wm_menu'
display_entry() {
- return 0
+ . /etc/grml/script-functions
+ check4progs grml-x >/dev/null
+ return $?
}
# variable definition {{{
print_available_wm() {
. /etc/grml/script-functions
LEN=0
+ AVAILABLE_WM_COUNT=0
local line
for key value in ${(kv)wms} ; do
fi
line+="$(highlight_char $value $key) "
LEN=$((${(c)#value} + $LEN))
+ AVAILABLE_WM_COUNT=$(($AVAILABLE_WM_COUNT + 1))
fi
done
output+="$line"
# print windowm manager loop {{{
wm_menu() {
+ if [ $AVAILABLE_WM_COUNT == 1 ]; then
+ run su grml -c "grml-x"
+ return
+ fi
echo
wm_heading
for line in ${output} ; do