nixos/dotfiles/waybar/scripts/power-menu.sh

17 lines
393 B
Bash
Raw Permalink Normal View History

2023-12-18 20:12:41 -07:00
#!/usr/bin/env bash
2023-12-14 17:23:01 -07:00
entries="Logout Suspend Reboot Shutdown"
selected=$(printf '%s\n' $entries | wofi --conf=$HOME/.config/wofi/config.power --style=$HOME/.config/wofi/style.widgets.css | awk '{print tolower($1)}')
case $selected in
logout)
swaymsg exit;;
suspend)
exec systemctl suspend;;
reboot)
exec systemctl reboot;;
shutdown)
exec systemctl poweroff -i;;
esac