mirror of
https://github.com/imgurbot12/rmenu.git
synced 2024-11-10 11:33:48 +01:00
feat: powermenu support hyprland
This commit is contained in:
parent
f68ae0064c
commit
fd364ec43c
@ -42,6 +42,18 @@ gen_confirm() {
|
|||||||
rmenu-build entry -n "$2" -I "$1" -a "`rmenu-build action "$SELF confirm '$2:$3'"`"
|
rmenu-build entry -n "$2" -I "$1" -a "`rmenu-build action "$SELF confirm '$2:$3'"`"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#: desc => determine which logout command to use based on window manager
|
||||||
|
get_logout_cmd() {
|
||||||
|
case "$XDG_CURRENT_DESKTOP" in
|
||||||
|
"sway") echo "sway exit" ;;
|
||||||
|
"Hyprland") echo "hyprctl dispatch exit" ;;
|
||||||
|
*)
|
||||||
|
session=`loginctl session-status | head -n 1 | awk '{print $1}'`
|
||||||
|
echo "loginctl terminate-session $session"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
#: desc => generate action-entry
|
#: desc => generate action-entry
|
||||||
#: usage => $icon $name $command $do-confirm
|
#: usage => $icon $name $command $do-confirm
|
||||||
action() {
|
action() {
|
||||||
@ -69,6 +81,6 @@ case "$1" in
|
|||||||
action "⏻" "Shutdown" "systemctl poweroff" "$confirm"
|
action "⏻" "Shutdown" "systemctl poweroff" "$confirm"
|
||||||
action "" "Reboot" "systemctl reboot" "$confirm"
|
action "" "Reboot" "systemctl reboot" "$confirm"
|
||||||
action "⏾" "Suspend" "systemctl suspend" "$confirm"
|
action "⏾" "Suspend" "systemctl suspend" "$confirm"
|
||||||
action "" "Log Out" "sway exit" "$confirm"
|
action "" "Log Out" "`get_logout_cmd`" "$confirm"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user