Fix lockhelper
Some checks failed
pre-commit / pre-commit (push) Failing after 16s

This commit is contained in:
Torjus Håkestad 2024-06-12 13:51:37 +02:00
parent 9607c002a6
commit ffe91246bd
2 changed files with 9 additions and 2 deletions

View File

@ -2,7 +2,7 @@ general {
lock_cmd = lockhelper # dbus/sysd lock command (loginctl lock-session) lock_cmd = lockhelper # dbus/sysd lock command (loginctl lock-session)
# unlock_cmd = notify-send "unlock!" # same as above, but unlock # unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = lockhelper # command ran before sleep before_sleep_cmd = lockhelper # command ran before sleep
# after_sleep_cmd = # command ran after sleep # after_sleep_cmd = lockhelper # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam) ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
} }

View File

@ -8,4 +8,11 @@ monitors=$(hyprctl monitors -j | jq -r '.[] | select( .name | contains ("DP")) |
while IFS= read -r m; do while IFS= read -r m; do
grim -o "$m" "/tmp/lockscreen/$m.png" || true grim -o "$m" "/tmp/lockscreen/$m.png" || true
done <<< "$monitors" done <<< "$monitors"
hyprlock
# Only lock if not already running
if [ -z "$(pgrep hyprlock)" ]
then
exec hyprlock
else
echo "Already locked"
fi