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
|
|
|
|
show_power_menu() {
|
2025-07-06 18:41:12 -07:00
|
|
|
local menu_options="\u200B Lock
|
|
|
|
\u200C Sleep
|
|
|
|
\u200D Relaunch
|
|
|
|
\u2060 Restart
|
|
|
|
\u2063 Shutdown" # These first characters are invisible sort keys
|
2025-07-06 15:11:56 -07:00
|
|
|
|
2025-07-06 18:41:12 -07:00
|
|
|
local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 200 --height 250 -O alphabetical)
|
2025-07-06 15:11:56 -07:00
|
|
|
|
2025-07-06 18:41:12 -07:00
|
|
|
case "$selection" in
|
|
|
|
*Lock*) hyprlock ;;
|
|
|
|
*Sleep*) systemctl suspend ;;
|
|
|
|
*Relaunch*) hyprctl dispatch exit ;;
|
|
|
|
*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
|