From e2deecc36a94ea15432c6e5d53a87412755d4f3d Mon Sep 17 00:00:00 2001 From: Alpha <43486986+sudoAlphaX@users.noreply.github.com> Date: Thu, 2 May 2024 17:18:17 +0530 Subject: [PATCH 1/2] add logout command for hyprland --- files/powermenu/type-1/powermenu.sh | 2 ++ files/powermenu/type-2/powermenu.sh | 2 ++ files/powermenu/type-3/powermenu.sh | 2 ++ files/powermenu/type-4/powermenu.sh | 2 ++ files/powermenu/type-5/powermenu.sh | 2 ++ files/powermenu/type-6/powermenu.sh | 2 ++ 6 files changed, 12 insertions(+) diff --git a/files/powermenu/type-1/powermenu.sh b/files/powermenu/type-1/powermenu.sh index dd978af..5c4566a 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 diff --git a/files/powermenu/type-2/powermenu.sh b/files/powermenu/type-2/powermenu.sh index 23d0795..61d07f9 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 diff --git a/files/powermenu/type-3/powermenu.sh b/files/powermenu/type-3/powermenu.sh index 8c1e47f..a415793 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 diff --git a/files/powermenu/type-4/powermenu.sh b/files/powermenu/type-4/powermenu.sh index 17f20c7..b886a51 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 diff --git a/files/powermenu/type-5/powermenu.sh b/files/powermenu/type-5/powermenu.sh index 561e30c..8c8167a 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 diff --git a/files/powermenu/type-6/powermenu.sh b/files/powermenu/type-6/powermenu.sh index ad93faf..7ac2759 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 From 7c6953721b9f588939d45498693d65075acc1c7f Mon Sep 17 00:00:00 2001 From: Alpha <43486986+sudoAlphaX@users.noreply.github.com> Date: Fri, 3 May 2024 10:14:37 +0530 Subject: [PATCH 2/2] add lock command for hyprlock --- files/powermenu/type-1/powermenu.sh | 2 ++ files/powermenu/type-2/powermenu.sh | 2 ++ files/powermenu/type-3/powermenu.sh | 2 ++ files/powermenu/type-4/powermenu.sh | 2 ++ files/powermenu/type-5/powermenu.sh | 2 ++ files/powermenu/type-6/powermenu.sh | 2 ++ 6 files changed, 12 insertions(+) diff --git a/files/powermenu/type-1/powermenu.sh b/files/powermenu/type-1/powermenu.sh index 5c4566a..0e773be 100755 --- a/files/powermenu/type-1/powermenu.sh +++ b/files/powermenu/type-1/powermenu.sh @@ -101,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 61d07f9..f555311 100755 --- a/files/powermenu/type-2/powermenu.sh +++ b/files/powermenu/type-2/powermenu.sh @@ -102,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 a415793..92d16b3 100755 --- a/files/powermenu/type-3/powermenu.sh +++ b/files/powermenu/type-3/powermenu.sh @@ -96,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 b886a51..7b42220 100755 --- a/files/powermenu/type-4/powermenu.sh +++ b/files/powermenu/type-4/powermenu.sh @@ -96,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 8c8167a..3e8bcc4 100755 --- a/files/powermenu/type-5/powermenu.sh +++ b/files/powermenu/type-5/powermenu.sh @@ -108,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 7ac2759..d27e66d 100755 --- a/files/powermenu/type-6/powermenu.sh +++ b/files/powermenu/type-6/powermenu.sh @@ -108,6 +108,8 @@ case ${chosen} in betterlockscreen -l elif [[ -x '/usr/bin/i3lock' ]]; then i3lock + elif [[ -x '/usr/bin/hyprlock' ]]; then + hyprlock fi ;; $suspend)