Files
omarchy/bin/omarchy-power-menu
2025-07-05 17:12:03 +10:00

41 lines
737 B
Bash
Executable File

#!/bin/bash
# Power menu for Omarchy
# Provides power off, restart, and sleep options
# Function to show power menu
show_power_menu() {
local menu_options="󰐥 Power Off
󰜉 Restart
󰤄 Sleep
󰍃 Logout
󰒲 Lock"
# 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
"󰐥 Power Off")
systemctl poweroff
;;
"󰜉 Restart")
systemctl reboot
;;
"󰤄 Sleep")
systemctl suspend
;;
"󰍃 Logout")
hyprctl dispatch exit
;;
"󰒲 Lock")
hyprlock
;;
*)
;;
esac
fi
}
# Main execution
show_power_menu