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