Files
omarchy/bin/omarchy-power-menu
2025-07-07 11:04:40 -07:00

26 lines
724 B
Bash
Executable File

#!/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.
show_power_menu() {
local menu_options="\u200B Lock
\u200C󰤄 Sleep
\u200D Relaunch
\u2060󰜉 Restart
󰐥\u2063 Shutdown"
local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 150 --height 195 -O alphabetical --style ~/.local/share/omarchy/config/wofi/omarchy-power-menu.css)
case "$selection" in
*Lock*) hyprlock ;;
*Sleep*) systemctl suspend ;;
*Relaunch*) hyprctl dispatch exit ;;
*Restart*) systemctl reboot ;;
*Shutdown*) systemctl poweroff ;;
esac
}
# Main execution
show_power_menu