2019-10-26 20:05:31 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-01-11 18:51:29 +02:00
|
|
|
RESP=$(cat <<EOF | fzf +s --tac
|
|
|
|
Shutdown
|
|
|
|
Reboot
|
2020-01-08 23:06:53 +02:00
|
|
|
Suspend
|
|
|
|
Lock
|
2020-01-11 18:51:29 +02:00
|
|
|
Exit
|
2019-10-26 20:05:31 +03:00
|
|
|
EOF
|
|
|
|
);
|
|
|
|
|
|
|
|
case "$RESP" in
|
2020-01-11 18:51:29 +02:00
|
|
|
Shutdown)
|
|
|
|
systemctl poweroff
|
2019-10-26 20:05:31 +03:00
|
|
|
;;
|
|
|
|
Reboot)
|
|
|
|
systemctl reboot
|
|
|
|
;;
|
2020-01-11 18:51:29 +02:00
|
|
|
Suspend)
|
|
|
|
systemctl suspend
|
2019-10-26 20:05:31 +03:00
|
|
|
;;
|
2020-01-08 23:06:53 +02:00
|
|
|
Lock)
|
2020-01-11 18:51:29 +02:00
|
|
|
loginctl lock-session $(loginctl show-user $USER -p Sessions | cut -d'=' -f2)
|
|
|
|
;;
|
|
|
|
Exit)
|
2020-03-02 21:37:48 +02:00
|
|
|
swaymsg exit
|
2020-01-08 23:06:53 +02:00
|
|
|
;;
|
2019-10-26 20:05:31 +03:00
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
esac
|