home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / linux / puppy-barebones-2.01r2.iso / pup_201.sfs / usr / local / jwmconfig / default < prev    next >
Encoding:
Text File  |  2005-09-22  |  1.5 KB  |  84 lines

  1. #!/bin/bash
  2.  
  3. #############################
  4. #
  5. #  GUI to switch between personal
  6. #  and default JWM configurations
  7. #  
  8. #  for use with the jwmConfigMgr
  9. #
  10. #  author: thoughtjourney
  11. #  date: 13/08/2005
  12. #
  13. #
  14. #############################
  15.  
  16.  
  17. #--------variables---------->>
  18.  
  19. CONFIG="/root/.jwm/jwmrc-personal"
  20. CONFSAVE="/root/.jwm/jwmrc-personal-save"
  21.  
  22. CHOICE=default
  23. DEFAULT=
  24. INCLUDE=
  25.  
  26. if [ -f $CONFIG ]; then
  27.     cp $CONFIG $CONFSAVE
  28.     DEFAULT=off                                
  29.     INCLUDE=ON
  30. else
  31.     DEFAULT=ON
  32.     INCLUDE=off
  33. fi
  34.  
  35. #----------dialogue-------->>
  36.  
  37. Xdialog --title "Use Personal Profile" \
  38.         --radiolist "Choose to use your own profile or the theme default settings:\n\n" 0 0 2 \
  39. "default"  "Use theme default settings" $DEFAULT \
  40. "personal" "Use profile settings" $INCLUDE 2> /tmp/inputbox.tmp.$$
  41.  
  42. retval=$?
  43.  
  44. #--------cancel pressed----->>
  45. case $retval in
  46.   255)
  47.     exit 0;;
  48. esac
  49.  
  50. #---------save changes----->>
  51.  
  52. CHOICE=`cat /tmp/inputbox.tmp.$$`
  53. rm -f /tmp/inputbox.tmp.$$
  54.  
  55. if [ "$CHOICE" = "default" ]; then
  56. echo $CHOICE
  57.    if [ "$DEFAULT" = "off" ]; then
  58.       mv $CONFIG $CONFSAVE
  59.    fi
  60. else if [ "$CHOICE" = "personal" ]; then
  61.    if [ "$DEFAULT" = "ON" ]; then
  62.       mv $CONFSAVE $CONFIG
  63.    fi
  64.  fi   
  65. fi
  66.  
  67. #----notify of result----->>
  68.  
  69. if [ -f $CONFIG ]; then
  70.    Xdialog --title "Setting" --msgbox "Your personal settings will be used" 0 0
  71. else
  72.    Xdialog --title "Setting" --msgbox "The default theme settings will be used" 0 0
  73. fi
  74.  
  75. #--------clean exit------->>
  76. case $retval in
  77.   1)
  78.     exit 0;;
  79.   255)
  80.     exit 0;;
  81. esac
  82.  
  83. exit 0
  84.