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 if [ "$(cat /proc/1/comm 2>/dev/null)" = "systemd" ] ; then
18 # variable definition {{{
24 # window manager definition {{{
46 # deteremine installed window managers {{{
47 print_available_wm() {
48 . /etc/grml/script-functions
53 for key value in ${(kv)wms} ; do
54 if check4progs $value >/dev/null 2>&1 ; then
55 available[$key]=$value
56 # test if word could be added to current line
57 if [ $((${(c)#value} + $LEN)) -ge $(($MAXLEN-9)) ] ; then
62 line+="$(highlight_char $value $key) "
63 LEN=$((${(c)#value} + $LEN))
64 AVAILABLE_WM_COUNT=$(($AVAILABLE_WM_COUNT + 1))
71 # heading for wm menu {{{
74 print_line "Select a window manager (unsorted list):"
75 print_line "Press any other key to return to the main menu."
80 # print windowm manager loop {{{
82 if [ $AVAILABLE_WM_COUNT == 1 ]; then
89 run sudo -u grml grml-x
95 for line in ${output} ; do
105 mkdir -p /var/run/grml-x/
106 echo "${available[$INPUT]}" > /var/run/grml-x/window-manager
111 run sudo -u grml -c "grml-x ${available[$INPUT]}"
120 ## END OF FILE #################################################################
121 # vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=2