mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 20:29: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
|
# Function to show power menu
|
||||||
show_power_menu() {
|
show_power_menu() {
|
||||||
local menu_options=" Lock
|
local menu_options="\u200B Lock
|
||||||
Sleep
|
\u200C Sleep
|
||||||
Restart
|
\u200D Relaunch
|
||||||
Shutdown"
|
\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 250 -O alphabetical)
|
||||||
local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 200 --height 210)
|
|
||||||
|
|
||||||
if [ -n "$selection" ]; then
|
|
||||||
case "$selection" in
|
case "$selection" in
|
||||||
" Shutdown")
|
*Lock*) hyprlock ;;
|
||||||
systemctl poweroff
|
*Sleep*) systemctl suspend ;;
|
||||||
;;
|
*Relaunch*) hyprctl dispatch exit ;;
|
||||||
" Restart")
|
*Restart*) systemctl reboot ;;
|
||||||
systemctl reboot
|
*Shutdown*) systemctl poweroff ;;
|
||||||
;;
|
|
||||||
" Sleep")
|
|
||||||
systemctl suspend
|
|
||||||
;;
|
|
||||||
" Lock")
|
|
||||||
hyprlock
|
|
||||||
;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Main execution
|
# Main execution
|
||||||
|
Reference in New Issue
Block a user