Improve lockhelper for gunter

This commit is contained in:
Torjus Håkestad 2024-06-11 00:53:59 +02:00
parent d5855878d3
commit eb0c53d8e2
6 changed files with 43 additions and 9 deletions

View File

@ -1,12 +1,12 @@
general {
lock_cmd = hyprlock # dbus/sysd lock command (loginctl lock-session)
# unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = hyprlock # command ran before sleep
before_sleep_cmd = lockhelper # command ran before sleep
# after_sleep_cmd = # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
}
listener {
timeout = 240 # in seconds
on-timeout = hyprlock # command to run when timeout has passed
on-timeout = lockhelper # command to run when timeout has passed
}

View File

@ -132,7 +132,7 @@
"$mainMod,Return,exec,$term"
# hyprlock
"$shiftMainMod,l,exec,hyprlock"
"$shiftMainMod,l,exec,lockhelper"
# rofi
"$mainMod,D,exec,rofi-launcher"

View File

@ -1,7 +1,35 @@
# BACKGROUND
background {
monitor =
path = ~/wallpapers/current
monitor = DP-5
path = /tmp/lockscreen/DP-5.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
background {
monitor = DP-6
path = /tmp/lockscreen/DP-6.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
background {
monitor = DP-7
path = /tmp/lockscreen/DP-7.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
background {
monitor = DP-8
path = /tmp/lockscreen/DP-8.png
blur_passes = 3
contrast = 0.8916
brightness = 0.8172

View File

@ -3,7 +3,8 @@ let
lockhelper = pkgs.writeShellApplication {
name = "lockhelper";
runtimeInputs = with pkgs; [
grimblast
grim
jq
];
text = (builtins.readFile ./lockhelper.sh);
};

View File

@ -1,6 +1,11 @@
#!/usr/bin/env bash
set -eo pipefail
grimblast save output /tmp/lock.png || true
hyprlock
mkdir -p /tmp/lockscreen || true
monitors=$(hyprctl monitors -j | jq -r '.[] | select( .name | contains ("DP")) | .name')
while IFS= read -r m; do
grim -o "$m" "/tmp/lockscreen/$m.png" || true
done <<< "$monitors"
hyprlock

View File

@ -39,7 +39,7 @@ if command -v wal &> /dev/null; then
wal -i "$wallpaper_path"
fi
unlink "$WALLPAPER_DIR/current" || true
unlink "$WALLPAPER_DIR/current.png" || true
ln -s "$wallpaper_path" "$WALLPAPER_DIR/current.png"
for monitor in $(hyprctl monitors | grep 'Monitor' | awk '{ print $2 }'); do