home *** CD-ROM | disk | FTP | other *** search
- #!/bin/bash
-
- #############################
- #
- # GUI to switch between personal
- # and default JWM configurations
- #
- # for use with the jwmConfigMgr
- #
- # author: thoughtjourney
- # date: 13/08/2005
- #
- #
- #############################
-
-
- #--------variables---------->>
-
- CONFIG="/root/.jwm/jwmrc-personal"
- CONFSAVE="/root/.jwm/jwmrc-personal-save"
-
- CHOICE=default
- DEFAULT=
- INCLUDE=
-
- if [ -f $CONFIG ]; then
- cp $CONFIG $CONFSAVE
- DEFAULT=off
- INCLUDE=ON
- else
- DEFAULT=ON
- INCLUDE=off
- fi
-
- #----------dialogue-------->>
-
- Xdialog --title "Use Personal Profile" \
- --radiolist "Choose to use your own profile or the theme default settings:\n\n" 0 0 2 \
- "default" "Use theme default settings" $DEFAULT \
- "personal" "Use profile settings" $INCLUDE 2> /tmp/inputbox.tmp.$$
-
- retval=$?
-
- #--------cancel pressed----->>
- case $retval in
- 255)
- exit 0;;
- esac
-
- #---------save changes----->>
-
- CHOICE=`cat /tmp/inputbox.tmp.$$`
- rm -f /tmp/inputbox.tmp.$$
-
- if [ "$CHOICE" = "default" ]; then
- echo $CHOICE
- if [ "$DEFAULT" = "off" ]; then
- mv $CONFIG $CONFSAVE
- fi
- else if [ "$CHOICE" = "personal" ]; then
- if [ "$DEFAULT" = "ON" ]; then
- mv $CONFSAVE $CONFIG
- fi
- fi
- fi
-
- #----notify of result----->>
-
- if [ -f $CONFIG ]; then
- Xdialog --title "Setting" --msgbox "Your personal settings will be used" 0 0
- else
- Xdialog --title "Setting" --msgbox "The default theme settings will be used" 0 0
- fi
-
- #--------clean exit------->>
- case $retval in
- 1)
- exit 0;;
- 255)
- exit 0;;
- esac
-
- exit 0
-