Files
omarchy/bin/omarchy-power-menu

37 lines
671 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
show_power_menu() {
2025-07-06 15:11:56 -07:00
local menu_options=" Lock
2025-07-05 17:12:03 +10:00
󰤄 Sleep
2025-07-06 15:11:56 -07:00
󰜉 Restart
󰐥 Shutdown"
# Show menu and get selection
local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 200 --height 250)
if [ -n "$selection" ]; then
case "$selection" in
"󰐥 Shutdown")
2025-07-05 17:12:03 +10:00
systemctl poweroff
;;
"󰜉 Restart")
systemctl reboot
;;
"󰤄 Sleep")
systemctl suspend
;;
2025-07-06 15:11:56 -07:00
" Lock")
2025-07-05 17:12:03 +10:00
hyprlock
;;
2025-07-06 15:11:56 -07:00
*) ;;
esac
fi
2025-07-05 17:12:03 +10:00
}
# Main execution
2025-07-06 15:11:56 -07:00
show_power_menu