mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
Fix up menu with sorting and a relaunch hyprland option
This commit is contained in:
@ -5,31 +5,21 @@
|
||||
|
||||
# Function to show power menu
|
||||
show_power_menu() {
|
||||
local menu_options=" Lock
|
||||
Sleep
|
||||
Restart
|
||||
Shutdown"
|
||||
local menu_options="\u200B Lock
|
||||
\u200C Sleep
|
||||
\u200D Relaunch
|
||||
\u2060 Restart
|
||||
\u2063 Shutdown" # These first characters are invisible sort keys
|
||||
|
||||
# Show menu and get selection
|
||||
local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 200 --height 210)
|
||||
local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 200 --height 250 -O alphabetical)
|
||||
|
||||
if [ -n "$selection" ]; then
|
||||
case "$selection" in
|
||||
" Shutdown")
|
||||
systemctl poweroff
|
||||
;;
|
||||
" Restart")
|
||||
systemctl reboot
|
||||
;;
|
||||
" Sleep")
|
||||
systemctl suspend
|
||||
;;
|
||||
" Lock")
|
||||
hyprlock
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
fi
|
||||
case "$selection" in
|
||||
*Lock*) hyprlock ;;
|
||||
*Sleep*) systemctl suspend ;;
|
||||
*Relaunch*) hyprctl dispatch exit ;;
|
||||
*Restart*) systemctl reboot ;;
|
||||
*Shutdown*) systemctl poweroff ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Main execution
|
||||
|
Reference in New Issue
Block a user