34 lines
639 B
Bash
Executable File
34 lines
639 B
Bash
Executable File
#!/bin/sh
|
|
|
|
option="$(printf " Log out\n⏻ Shutdown\n Reboot\n Suspend\n Hibernate" | \
|
|
wofi --dmenu -p "Session")"
|
|
|
|
dialogue_box() {
|
|
yad --image=gtk-dialog-question \
|
|
--text="$1"
|
|
}
|
|
|
|
dialogue_box "Are you sure?" || exit 0
|
|
|
|
case $option in
|
|
*Log\ out)
|
|
pkill -u $USER
|
|
;;
|
|
*Shutdown)
|
|
systemctl poweroff -i
|
|
;;
|
|
*Reboot)
|
|
systemctl reboot -i
|
|
;;
|
|
*Suspend)
|
|
~/.local/bin/scripts/system/screenlock &
|
|
sleep 1
|
|
systemctl suspend -i
|
|
;;
|
|
*Hibernate)
|
|
~/.local/bin/scripts/system/screenlock &
|
|
sleep 1
|
|
systemctl hibernate -i
|
|
;;
|
|
esac
|