Add quit menu instead of yes/no prompt on hyprland exit

This commit is contained in:
ItsDrike 2023-01-25 01:31:37 +01:00
parent 7a81a38d10
commit 6d8590b0dc
No known key found for this signature in database
GPG key ID: B014E761034AF742
2 changed files with 26 additions and 1 deletions

View file

@ -160,7 +160,7 @@ $MOUSE_EX1 = mouse:275
$MOUSE_EX2 = mouse:276 $MOUSE_EX2 = mouse:276
# DE/WM control # DE/WM control
bind = SUPER_SHIFT, Q, exec, menuprompt --yesno -p "Quit Hyprland?" && hyprctl dispatch exit "" bind = SUPER_SHIFT, Q, exec, menuquit
bind = SUPER_CTRL, L, exec, loginctl lock-session bind = SUPER_CTRL, L, exec, loginctl lock-session
bind = SUPER_SHIFT, L, exec, wlogout -p layer-shell bind = SUPER_SHIFT, L, exec, wlogout -p layer-shell
bind = SUPER_SHIFT, T, exec, toggle-idle bind = SUPER_SHIFT, T, exec, toggle-idle

View file

@ -0,0 +1,25 @@
#!/bin/bash
action="$(printf 'Quit WM\nLock session\nLock TTYs\nPoweroff\nReboot\nNothing' | menuprompt -c --app wofi -p "Select Action" -- -O default)"
case "$action" in
"Quit WM")
hyprctl dispatch exit ""
;;
"Lock session")
loginctl lock-session
;;
"Lock TTYs")
physlock
;;
"Poweroff")
systemctl poweroff
;;
"Reboot")
systemctl reboot
;;
"Nothing") ;&
*)
exit 1
;;
esac