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

33 lines
637 B
Bash
Executable File

#!/bin/sh
option="$(printf "󰍃 Log out\n⏻ Shutdown\n Reboot\n Suspend\n Hibernate" | wofi --dmenu -p "Session")" || exit 0
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