#!/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 500 --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 "Wifi Network Selector" \
10 "Reboot" \
11 "Shutdown" \
12 "Apply Software and Configuration Updates (GNC)" \
13 "Make a Bootable USB Drive from an ISO image" \
14 "xterm (command line) as root user" \
15 "xterm (command line) as current user" \
16 "Groovix Automatic Re-Image" \
17 "Groovix Automatic Installation (to another drive)" \
18 "View the Groovix Administration Guide" \
19 "Custom Admin Menu" \
`

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 ) groovix-wifi-network-selector;;
 10 ) shutdown -r now;;
 11 ) shutdown -h now;;
 12 ) xterm -geometry 160x40 -e "groovix-net-control --from=gam";;
 13 ) groovix-usb-creator --gui;;
 14 ) xterm ;;
 15 ) xterm -e "su `cat /var/lib/groovix/session-info/current-user` " ;;
 16 ) groovix-auto-re-image;;
 17 ) xterm -geometry 160x40 -e groovix-installer-wrapper;;
 18 ) firefox http://wiki.groovix.org/index.php?title=Administrators_Guide;;
 19 ) groovix-custom-admin-menu;;
  *             ) echo "Unknown Command!";;
esac      #  Allows ranges of characters in [square brackets],
          #+ or POSIX ranges in [[double square brackets.

done
