From fb4f8a86f438dfca0acb8cbf19b97e9ce42ce07a Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 9 Aug 2025 08:56:12 +0700 Subject: [PATCH] lock screen: use quickshell, add hack for window refocus --- .config/hypr/hypridle.conf | 4 ++-- .config/quickshell/ii/modules/lock/Lock.qml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.config/hypr/hypridle.conf b/.config/hypr/hypridle.conf index bb6ecccd2..a77bbb242 100644 --- a/.config/hypr/hypridle.conf +++ b/.config/hypr/hypridle.conf @@ -1,5 +1,5 @@ -# $lock_cmd = hyprctl dispatch global quickshell:lock & pidof qs quickshell hyprlock || hyprlock -$lock_cmd = pidof hyprlock || hyprlock +$lock_cmd = hyprctl dispatch global quickshell:lock & pidof qs quickshell hyprlock || hyprlock +# $lock_cmd = pidof hyprlock || hyprlock $suspend_cmd = systemctl suspend || loginctl suspend general { diff --git a/.config/quickshell/ii/modules/lock/Lock.qml b/.config/quickshell/ii/modules/lock/Lock.qml index 89d39778a..2024c19b2 100644 --- a/.config/quickshell/ii/modules/lock/Lock.qml +++ b/.config/quickshell/ii/modules/lock/Lock.qml @@ -19,6 +19,9 @@ Scope { // Unlock the screen before exiting, or the compositor will display a // fallback lock you can't interact with. GlobalStates.screenLocked = false; + + // Refocus last focused window on unlock (hack) + Quickshell.execDetached(["bash", "-c", `sleep 0.2; hyprctl --batch "dispatch togglespecialworkspace; dispatch togglespecialworkspace"`]) } }