From 79f7a3c52e2d4961125a0312b8e30ea18e3ef61b Mon Sep 17 00:00:00 2001 From: "SilverAg.L" Date: Thu, 30 Oct 2025 07:05:02 +0800 Subject: [PATCH] workaround of gtklock#130. --- .config/niri/config.kdl | 2 +- bin/lock-hibernate.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 bin/lock-hibernate.sh diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl index e625879..05e59ba 100644 --- a/.config/niri/config.kdl +++ b/.config/niri/config.kdl @@ -277,7 +277,7 @@ binds { Mod+Alt+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } Mod+Shift+Escape hotkey-overlay-title="Exit niri" { quit; } Super+Escape hotkey-overlay-title="Lock the Screen (gtklock)" { spawn "gtklock" "-d"; } - Mod+Delete hotkey-overlay-title="Lock screen and Hibernate ..." { spawn-sh "gtklock -d && sleep 3 && systemctl hibernate"; } + Mod+Delete hotkey-overlay-title="Lock screen and Hibernate ..." allow-when-locked=true { spawn "~/.niri-dotfiles/bin/lock-hibernate.sh"; } XF86AudioRaiseVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.01+"; } XF86AudioLowerVolume hotkey-overlay-title=null allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.01-"; } diff --git a/bin/lock-hibernate.sh b/bin/lock-hibernate.sh new file mode 100755 index 0000000..972cacf --- /dev/null +++ b/bin/lock-hibernate.sh @@ -0,0 +1,4 @@ +#!/bin/bash +pgrep gtklock || gtklock -d +sleep 1 +systemctl hibernate