From 90c271292b901e7af9ea9e84422b99e30915bdbb Mon Sep 17 00:00:00 2001 From: Jedsek Date: Sat, 3 Dec 2022 18:13:39 +0800 Subject: [PATCH] Add support for Hyprland-wm --- files/powermenu/type-1/powermenu.sh | 4 ++++ files/powermenu/type-2/powermenu.sh | 4 ++++ files/powermenu/type-3/powermenu.sh | 4 ++++ files/powermenu/type-4/powermenu.sh | 4 ++++ files/powermenu/type-5/powermenu.sh | 4 ++++ files/powermenu/type-6/powermenu.sh | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/files/powermenu/type-1/powermenu.sh b/files/powermenu/type-1/powermenu.sh index dd978af..679bf3e 100755 --- a/files/powermenu/type-1/powermenu.sh +++ b/files/powermenu/type-1/powermenu.sh @@ -78,6 +78,8 @@ run_cmd() { i3-msg exit elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then + hyprctl dispatch exit 1 fi fi else @@ -99,6 +101,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/swaylock' ]]; then + swaylock fi ;; $suspend) diff --git a/files/powermenu/type-2/powermenu.sh b/files/powermenu/type-2/powermenu.sh index 23d0795..ff30540 100755 --- a/files/powermenu/type-2/powermenu.sh +++ b/files/powermenu/type-2/powermenu.sh @@ -79,6 +79,8 @@ run_cmd() { i3-msg exit elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then + hyprctl dispatch exit 1 fi fi else @@ -100,6 +102,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/swaylock' ]]; then + swaylock fi ;; $suspend) diff --git a/files/powermenu/type-3/powermenu.sh b/files/powermenu/type-3/powermenu.sh index 8c1e47f..f354b97 100755 --- a/files/powermenu/type-3/powermenu.sh +++ b/files/powermenu/type-3/powermenu.sh @@ -73,6 +73,8 @@ run_cmd() { i3-msg exit elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then + hyprctl dispatch exit 1 fi fi else @@ -94,6 +96,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/swaylock' ]]; then + swaylock fi ;; $suspend) diff --git a/files/powermenu/type-4/powermenu.sh b/files/powermenu/type-4/powermenu.sh index 17f20c7..b5cd093 100755 --- a/files/powermenu/type-4/powermenu.sh +++ b/files/powermenu/type-4/powermenu.sh @@ -73,6 +73,8 @@ run_cmd() { i3-msg exit elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then + hyprctl dispatch exit 1 fi fi else @@ -94,6 +96,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/swaylock' ]]; then + swaylock fi ;; $suspend) diff --git a/files/powermenu/type-5/powermenu.sh b/files/powermenu/type-5/powermenu.sh index 561e30c..5628d3a 100755 --- a/files/powermenu/type-5/powermenu.sh +++ b/files/powermenu/type-5/powermenu.sh @@ -82,6 +82,8 @@ run_cmd() { i3-msg exit elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then + hyprctl dispatch exit 1 fi fi else @@ -106,6 +108,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/swaylock' ]]; then + swaylock fi ;; $suspend) diff --git a/files/powermenu/type-6/powermenu.sh b/files/powermenu/type-6/powermenu.sh index ad93faf..fdcf5ee 100755 --- a/files/powermenu/type-6/powermenu.sh +++ b/files/powermenu/type-6/powermenu.sh @@ -82,6 +82,8 @@ run_cmd() { i3-msg exit elif [[ "$DESKTOP_SESSION" == 'plasma' ]]; then qdbus org.kde.ksmserver /KSMServer logout 0 0 0 + elif [[ "$DESKTOP_SESSION" == 'hyprland' ]]; then + hyprctl dispatch exit 1 fi fi else @@ -106,6 +108,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/swaylock' ]]; then + swaylock fi ;; $suspend)