1
0
Fork 0
mirror of https://gitlab.com/dwt1/dotfiles.git synced 2023-02-13 20:55:19 -05:00
dwt1--dotfiles/.jwm/menus/shutdown.sh
2019-01-15 15:27:01 -06:00

25 lines
484 B
Bash
Executable file

#!/bin/sh
DIALOG=Xdialog
$DIALOG --allow-close\
--stdout\
--title 'Exit'\
--menu 'Choose action..'\
15 50 10 \
'Shutdown' "" \
'Reboot' "" \
'Suspend to RAM' "" \
'Suspend to Disk' "" \
1> /tmp/exitval.$$ 2> /dev/null
ACTION=`cat /tmp/exitval.$$`
rm -f /tmp/exitval.$$
case $ACTION in
'Shutdown') sudo halt ;;
'Reboot') sudo reboot ;;
'Suspend to RAM') sudo s2ram ;;
'Suspend to Disk') sudo s2disk ;;
*) exit ;;
esac