dotfiles/system/.local/bin/power
Severin Kaderli 61012463fe
Clean up scripts
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
2022-05-11 20:59:42 +02:00

36 lines
639 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