helm/users/profiles/desktop/bin/powermenu

32 lines
672 B
Plaintext
Raw Normal View History

2021-11-13 09:47:38 -08:00
#!/usr/bin/env sh
rofi_command="rofi -theme theme/powermenu.rasi"
### Options ###
power_off="\tShutdown"
reboot="\tReboot"
lock="\tLock"
suspend="鈴\tSleep"
log_out="\tLogout"
# Variable passed to rofi
options="$power_off\n$reboot\n$lock\n$suspend\n$log_out"
2022-04-16 00:45:04 -07:00
case "$(echo -e "$options" | $rofi_command -dmenu)" in
2022-03-30 02:48:30 -07:00
" Shutdown")
systemctl poweroff
;;
" Reboot")
systemctl reboot
;;
" Lock")
2022-04-16 00:45:04 -07:00
dm-tool lock
2022-03-30 02:48:30 -07:00
;;
"鈴 Sleep")
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
systemctl suspend
;;
" Logout")
bspc quit
;;
2021-11-13 09:47:38 -08:00
esac