1 # window manager module for grml-quickconfig
2 LINE='print_line "Start ^x (/grml-x/)"'
7 . /etc/grml/script-functions
8 check4progs grml-x >/dev/null 2>&1
12 # variable definition {{{
18 # window manager definition {{{
40 # deteremine installed window managers {{{
41 print_available_wm() {
42 . /etc/grml/script-functions
47 for key value in ${(kv)wms} ; do
48 if check4progs $value >/dev/null 2>&1 ; then
49 available[$key]=$value
50 # test if word could be added to current line
51 if [ $((${(c)#value} + $LEN)) -ge $(($MAXLEN-9)) ] ; then
56 line+="$(highlight_char $value $key) "
57 LEN=$((${(c)#value} + $LEN))
58 AVAILABLE_WM_COUNT=$(($AVAILABLE_WM_COUNT + 1))
65 # heading for wm menu {{{
68 print_line "Select a window manager (unsorted list):"
69 print_line "Press any other key to return to the main menu."
74 # print windowm manager loop {{{
76 if [ $AVAILABLE_WM_COUNT == 1 ]; then
79 run sudo -u grml grml-x
84 for line in ${output} ; do
95 run sudo -u grml -c "grml-x ${available[$INPUT]}"
103 ## END OF FILE #################################################################
104 # vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3