27 lines
400 B
Bash
27 lines
400 B
Bash
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
chpower() {
|
|
case "$1" in
|
|
"")
|
|
;;
|
|
Shutdown)
|
|
exec systemctl poweroff
|
|
;;
|
|
Reboot)
|
|
exec systemctl reboot
|
|
;;
|
|
Hibernate)
|
|
exec systemctl hibernate
|
|
;;
|
|
*)
|
|
notify-send -t 1500 -u low "Invalid Option"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
OPTIONS="Shutdown\nReboot\nHibernate"
|
|
|
|
chpower "$(printf "%b" "$OPTIONS" | sort | rofi -dmenu -p "Power Menu")"
|
|
|