Files
omarchy/bin/omarchy-power-menu

26 lines
684 B
Plaintext
Raw Normal View History

2025-07-05 17:12:03 +10:00
#!/bin/bash
# Power menu for Omarchy
# Provides power off, restart, and sleep options
# Function to show power menu. The first characters are invisible sort keys.
2025-07-05 17:12:03 +10:00
show_power_menu() {
local menu_options="\u200B Lock
2025-07-07 11:09:10 -07:00
\u200C󰤄 Suspend
\u200D Relaunch
\u2060󰜉 Restart
2025-07-07 11:19:29 -07:00
\u2063󰐥 Shutdown"
local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 150 --height 195 -O alphabetical --style ~/.config/wofi/select.css)
2025-07-06 15:11:56 -07:00
case "$selection" in
*Lock*) hyprlock ;;
2025-07-07 11:09:10 -07:00
*Suspend*) systemctl suspend ;;
*Relaunch*) uwsm stop ;;
*Restart*) systemctl reboot ;;
*Shutdown*) systemctl poweroff ;;
esac
2025-07-05 17:12:03 +10:00
}
# Main execution
2025-07-06 15:11:56 -07:00
show_power_menu