wok-next view karmen/stuff/karmen-conf @ rev 13245
Move from undigest: turses
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Aug 14 13:39:29 2012 +0200 (2012-08-14) |
parents | 08943259e85e |
children |
line source
1 #!/bin/sh
2 #
3 #
4 : ${DIALOG=dialog}
6 CONFIG_DIR="$HOME/.config/karmen"
8 # Dialog menu.
9 exec 3>&1
10 value=`$DIALOG --clear \
11 --title " Karmen settings " \
12 --menu "" 15 70 5 \
13 "autostart" "Autostarted applications" \
14 "exitwm" "Exit Karmen session" \
15 "reboot" "Reboot system" \
16 "quit" "Quit Karmen configuration" \
17 2>&1 1>&3`
18 retval=$?
19 exec 3>&-
21 case $retval in
22 0) continue ;;
23 1) echo "Cancel pressed." && exit 0 ;;
24 255)
25 if test -n "$value"; then
26 echo "$value"
27 else
28 echo "ESC pressed." && exit 0
29 fi ;;
30 esac
32 case $value in
33 autostart)
34 nano $CONFIG_DIR/autostart.sh
35 exec $(basename $0) ;;
36 exitwm) killall karmen ;;
37 reboot) reboot || reboot -f ;;
38 quit) continue ;;
39 esac
41 exit 0