dotfiles/.local/bin/scripts/system/wofi-session

34 lines
639 B
Plaintext
Raw Normal View History

2023-05-26 13:29:25 +02:00
#!/bin/sh
option="$(printf "󰍃 Log out\n⏻ Shutdown\n Reboot\n Suspend\n Hibernate" | \
2023-05-26 13:29:25 +02:00
wofi --dmenu -p "Session")"
dialogue_box() {
yad --image=gtk-dialog-question \
--text="$1"
}
dialogue_box "Are you sure?" || exit 0
2023-05-26 13:29:25 +02:00
case $option in
*Log\ out)
pkill -u $USER
;;
2023-05-26 13:29:25 +02:00
*Shutdown)
systemctl poweroff -i
2023-05-26 13:29:25 +02:00
;;
*Reboot)
systemctl reboot -i
2023-05-26 13:29:25 +02:00
;;
*Suspend)
~/.local/bin/scripts/system/screenlock &
sleep 1
systemctl suspend -i
2023-05-26 13:29:25 +02:00
;;
*Hibernate)
~/.local/bin/scripts/system/screenlock &
sleep 1
systemctl hibernate -i
2023-05-26 13:29:25 +02:00
;;
esac