dotfiles/.config/rofi/scripts/powermenu.sh

37 lines
573 B
Bash
Raw Normal View History

2019-09-22 13:52:58 +03:00
OPTIONS="Reboot\nPoweroff\nSuspend\nHibernate\nLogout\nLock\n"
lock() {
WINDOW=:0 xscreensaver-command -lock
}
if [ "$@" ]
then
case $@ in
Exit)
i3-msg exit
;;
Logout)
i3-msg exit
;;
2019-09-22 13:52:58 +03:00
Reboot)
systemctl reboot
;;
Poweroff)
systemctl poweroff
;;
Suspend)
systemctl suspend
2019-09-22 13:52:58 +03:00
;;
Hibernate)
systemctl hibernate
2019-09-22 13:52:58 +03:00
;;
Lock)
WINDOW=:0 xscreensaver-command -lock
;;
2019-09-22 13:52:58 +03:00
*)
;;
esac
else
echo -en $OPTIONS
fi