2018-07-30 08:38:25 +00:00
|
|
|
#!/bin/sh
|
2020-03-22 12:44:57 +00:00
|
|
|
|
|
|
|
option="$(echo " lock| logout| sleep| hibernate| power off| reboot| windows" | \
|
|
|
|
rofi -sep "|" -dmenu -i -p "" -auto-select -hide-scrollbar -monitor 0 -width 10 -lines 7 -location 3 -tokenize false -matching normal | cut -d' ' -f2- | xargs)"
|
2016-04-02 17:59:24 +00:00
|
|
|
|
|
|
|
case $option in
|
2018-11-29 04:01:50 +00:00
|
|
|
lock) dm-tool switch-to-greeter;;
|
2020-03-22 12:34:05 +00:00
|
|
|
logout) systemctl --user exit;;
|
2016-04-02 17:59:24 +00:00
|
|
|
sleep) systemctl suspend;;
|
2018-03-29 10:17:58 +00:00
|
|
|
hibernate) systemctl hibernate;;
|
2017-01-25 00:47:06 +00:00
|
|
|
power\ off) systemctl poweroff;;
|
|
|
|
reboot) systemctl reboot;;
|
2016-04-04 03:04:20 +00:00
|
|
|
windows)
|
2022-10-23 23:17:44 +00:00
|
|
|
windows="$(efibootmgr | grep -Po -m1 'Boot\K(\d{4}).*Windows.*' | head -c4)"
|
2017-01-25 00:47:06 +00:00
|
|
|
sudo efibootmgr -n $windows
|
2022-10-23 23:17:44 +00:00
|
|
|
systemctl reboot;;
|
2016-04-02 17:59:24 +00:00
|
|
|
esac
|