helm/home/profiles/desktop/bin/powermenu
2023-08-16 23:35:52 -07:00

32 lines
676 B
Bash
Executable file

#!/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"
case "$(echo -e "$options" | $rofi_command -dmenu)" in
" Shutdown")
systemctl poweroff
;;
" Reboot")
systemctl reboot
;;
" Lock")
dm-tool lock
;;
"󰤄 Sleep")
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
systemctl suspend
;;
"󰍃 Logout")
bspc quit
;;
esac