From f78ad07406adeaee1ec95302faf3ba58772b8de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Gola=C5=84ski?= Date: Fri, 19 Apr 2024 10:45:05 +0200 Subject: [PATCH] added hyprland and hyprlock support for powermenus --- 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..0e773be 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 fi fi else @@ -99,6 +101,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/hyprlock' ]]; then + hyprlock fi ;; $suspend) diff --git a/files/powermenu/type-2/powermenu.sh b/files/powermenu/type-2/powermenu.sh index 23d0795..f555311 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 fi fi else @@ -100,6 +102,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/hyprlock' ]]; then + hyprlock fi ;; $suspend) diff --git a/files/powermenu/type-3/powermenu.sh b/files/powermenu/type-3/powermenu.sh index 8c1e47f..92d16b3 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 fi fi else @@ -94,6 +96,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/hyprlock' ]]; then + hyprlock fi ;; $suspend) diff --git a/files/powermenu/type-4/powermenu.sh b/files/powermenu/type-4/powermenu.sh index 17f20c7..7b42220 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 fi fi else @@ -94,6 +96,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/hyprlock' ]]; then + hyprlock fi ;; $suspend) diff --git a/files/powermenu/type-5/powermenu.sh b/files/powermenu/type-5/powermenu.sh index 561e30c..3e8bcc4 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 fi fi else @@ -106,6 +108,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/hyprlock' ]]; then + hyprlock fi ;; $suspend) diff --git a/files/powermenu/type-6/powermenu.sh b/files/powermenu/type-6/powermenu.sh index ad93faf..d27e66d 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 fi fi else @@ -106,6 +108,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/hyprlock' ]]; then + hyprlock fi ;; $suspend)