2025-07-05 17:12:03 +10:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
show_power_menu() {
|
2025-07-18 23:00:42 -05:00
|
|
|
# The first characters are invisible sort keys.
|
2025-07-31 21:25:50 +02:00
|
|
|
local menu_options=" Lock
|
|
|
|
Suspend
|
|
|
|
Relaunch
|
|
|
|
Restart
|
|
|
|
Shutdown"
|
2025-07-20 17:17:42 -04:00
|
|
|
local selection=$(echo -e "$menu_options" | walker --dmenu --theme dmenu_150)
|
2025-07-06 15:11:56 -07:00
|
|
|
|
2025-07-06 18:41:12 -07:00
|
|
|
case "$selection" in
|
|
|
|
*Lock*) hyprlock ;;
|
2025-07-07 11:09:10 -07:00
|
|
|
*Suspend*) systemctl suspend ;;
|
2025-07-13 20:51:03 -04:00
|
|
|
*Relaunch*) uwsm stop ;;
|
2025-07-06 18:41:12 -07:00
|
|
|
*Restart*) systemctl reboot ;;
|
|
|
|
*Shutdown*) systemctl poweroff ;;
|
|
|
|
esac
|
2025-07-05 17:12:03 +10:00
|
|
|
}
|
|
|
|
|
2025-07-06 15:11:56 -07:00
|
|
|
show_power_menu
|