1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00
dotfiles/.config/i3/powermenu.sh

19 lines
612 B
Bash
Raw Normal View History

2018-07-30 08:38:25 +00:00
#!/bin/sh
2018-07-30 08:38:25 +00:00
option=$(echo "lock|logout|sleep|hibernate|power off|reboot|windows" | rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 8 -lines 7 -location 3 -tokenize false -matching normal | xargs)
case $option in
lock) dm-tool switch-to-greeter;;
logout) i3-msg exit;;
sleep) systemctl suspend;;
2018-03-29 10:17:58 +00:00
hibernate) systemctl hibernate;;
power\ off) systemctl poweroff;;
reboot) systemctl reboot;;
windows)
windows=`efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4`
sudo efibootmgr -n $windows
2018-03-29 10:17:58 +00:00
sudo hibereboot;;
esac
exit 0