36 lines
640 B
Bash
Executable file
36 lines
640 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# The rofi prompt
|
|
PROMPT="Power Options"
|
|
|
|
# Actions for the menu
|
|
ACTIONS=(
|
|
"1: Reboot"
|
|
"2: Shutdown"
|
|
"3: Suspend"
|
|
"4: Lock Screen"
|
|
"5: Performance Mode"
|
|
"6: Powersave Mode"
|
|
)
|
|
|
|
SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | fuzzel --dmenu -I | cut -d ":" -f1)
|
|
|
|
case "${SELECTION}" in
|
|
"1")
|
|
systemctl reboot
|
|
;;
|
|
"2")
|
|
systemctl poweroff
|
|
;;
|
|
"3")
|
|
systemctl suspend
|
|
;;
|
|
"4")
|
|
screenlock
|
|
;;
|
|
"5")
|
|
gksu "cpupower frequency-set -g performance"
|
|
;;
|
|
"6")
|
|
gksu "cpupower frequency-set -g powersave"
|
|
esac
|