helm/home/profiles/desktop/bin/powermenu

32 lines
676 B
Plaintext
Raw Permalink Normal View History

2022-09-18 15:13:50 -07:00
#!/usr/bin/env sh
rofi_command="rofi -theme theme/powermenu.rasi"
### Options ###
power_off="\tShutdown"
reboot="\tReboot"
2023-08-16 23:35:52 -07:00
lock="\tLock"
suspend="󰤄\tSleep"
log_out="󰍃\tLogout"
2022-09-18 15:13:50 -07:00
# Variable passed to rofi
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
case "$(echo -e "$options" | $rofi_command -dmenu)" in
" Shutdown")
systemctl poweroff
;;
" Reboot")
systemctl reboot
;;
2023-08-16 23:35:52 -07:00
" Lock")
2022-09-18 15:13:50 -07:00
dm-tool lock
;;
2023-08-16 23:35:52 -07:00
"󰤄 Sleep")
2022-09-18 15:13:50 -07:00
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
systemctl suspend
;;
2023-08-16 23:35:52 -07:00
"󰍃 Logout")
2022-09-18 15:13:50 -07:00
bspc quit
;;
esac