#!/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 Staff 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" \
5 "User Environment Settings" \
8 "Reboot" \
9 "Shutdown" \
10 "Wifi Network Selector" \
11 "Make a Bootable USB Drive from an ISO image" \
12 "xterm (command line) as gxstaff user" \
13 "Groovix Automatic Re-Installation (will completely erase current hard drive contents)" \
14 "View the Groovix Administration Guide" \
15 "Custom Staff Menu" \
`

ZENRETURN=$?


case "$MYTASK" in
  1 ) xterm -e /usr/bin/groovix-vnc-connect-util;;
  2 ) system-config-printer;;
  3 ) groovix-cancel-timeouts;;
  5 ) su `cat /var/lib/groovix/session-info/current-user` -c xfce4-settings-manager;;
  8 ) shutdown -r now;;
  9 ) shutdown -h now;;
 10 ) groovix-wifi-network-selector;;
 11 ) groovix-usb-creator --gui;;
 12 ) xterm -e "su gxstaff" ;;
 13 ) groovix-auto-re-install;;
 14 ) firefox http://wiki.groovix.org/index.php?title=Administrators_Guide;;
 15 ) groovix-custom-staff-menu;;
  *             ) echo "Unknown Command!";;
esac      #  Allows ranges of characters in [square brackets],
          #+ or POSIX ranges in [[double square brackets.

done
