#!/bin/bash

ZENRETURN=0
while [ $ZENRETURN -eq 0 ]
do
#MYTASK=`zenity --height 400 --width 600 --list --title "Groovix Admin Menu (running on Display $DISPLAY)" --text "Double Click on a task below to run it" --column ""  --column "" 1 "Printer Administration" 2 "Network Settings" 4 "Open an xterm as the root user"  5 "Connect to Groovix Tech Support" 6 "Change Groovix Settings" 7 "System Monitor" 8 "Make Permanent Changes to the User Environment" 9 "Restart all Displays" 10 "Reboot the machine" 11 "Shutdown the machine" 12 "System Settings Administration" 13 "Groovix PAC Hard Drive Interactive Installation" 14 "Groovix PAC LIVE install to USB or hard drive" 15 "View the Groovix Administration Guide"`

#note: maybe use --hide-column=1 to look better?  but numbers might come in handy while talking someone through on the phone


MYTASK=`zenity --hide-header --height 1000 --width 600 --list --title "Groovix Admin Menu (running on Display $DISPLAY)" --text "Double click or hit enter on a task below to run it" --column ""  --column "" \
1 "Connect to Groovix Tech Support" \
2 "Printer Administration" \
3 "Keep Session Alive - stop inactivity and quota timeouts" \
4 "Disable Closing Time Shutdown" \
5 "Make Permanent Changes to the User Environment" \
6 "User Environment Settings" \
7 "Groovix Configuration" \
8 "Network Configuration" \
9 "Reboot" \
10 "Shutdown" \
11 "Apply Software and Configuration Updates (GNC)" \
12 "Make a Bootable USB Drive from an ISO image" \
13 "xterm (command line) as root user" \
14 "xterm (command line) as current user" \
15 "Groovix Automatic Re-Image" \
16 "View the Groovix Administration Guide" \
`

ZENRETURN=$?


case "$MYTASK" in
  1 ) xterm -e /usr/bin/groovix-vnc-connect-util;;
  2 ) system-config-printer;;
  3 ) groovix-cancel-timeouts;;
  4 ) groovix-closing-timer-cancel;;
  5 ) groovix-modify-user-environment;;
  6 ) su `cat /var/lib/groovix/session-info/current-user` -c xfce4-settings-manager;;
  7 ) groovix-configuration-editor;;
  8 ) groovix-configure-network;;
  9 ) shutdown -r now;;
 10 ) shutdown -h now;;
 11 ) xterm -geometry 160x40 -e "groovix-net-control --from=gam";;
 12 ) groovix-usb-creator --gui;;
 13 ) xterm ;;
 14 ) xterm -e "su `cat /var/lib/groovix/session-info/current-user` " ;;
 15 ) groovix-auto-re-image;;
 16 ) firefox http://wiki.groovix.org/index.php?title=Administrators_Guide;;
  *             ) echo "Unknown Command!";;
esac      #  Allows ranges of characters in [square brackets],
          #+ or POSIX ranges in [[double square brackets.

done
