blob: 43c2250a53fd7d2fbf8e9bab9c26935a46f36dba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/sh -eu
ACTION=$(zenity --width=90 \
--height=210 --list --radiolist --text="Select Action" \
--title="Logout" --column "Choice" --column "Action" \
FALSE Shutdown FALSE Reboot TRUE Suspend FALSE Lock FALSE Blank)
if [ -n "${ACTION}" ]; then
case $ACTION in
Shutdown) zenity --question --text "Are you sure you want to halt?" && sudo -A 'systemctl poweroff' ;;
Reboot) zenity --question --text "Are you sure you want to reboot?" && sudo -A 'systemctl reboot' ;;
Suspend) systemctl suspend ;;
Lock) i3lock-fancy ;;
Blank) sleep 1; xset dpms force off ;;
esac
fi
|