This repository has been archived on 2024-07-10. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles-nix/apps/swaylock/lock.sh

55 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env zsh
# get active monitors
active_monitors=($(hyprctl monitors | grep -i monitor | awk '{print $2}'))
home_dir=$(xdg-user-dir)
# create blurred images per active screen
for monitor in ${active_monitors}
do
# variables
image=/tmp/swaylock_$monitor.png
image_blur=/tmp/swaylock_blur_$monitor.png
lockargs=($lockargs --image $monitor:$image_blur)
# create image
grim -o $monitor $image
# create blurred image
convert $image -blur 0x5 $image_blur
done
# lock the screen using the newly created image
swaylock \
--scaling center \
--hide-keyboard-layout \
--indicator-radius 100 \
--indicator-thickness 5 \
--ring-color 285577ff \
--ring-ver-color 89b4fa \
--ring-wrong-color f38ba8 \
--ring-clear-color a6e3a1 \
--key-hl-color 1e1e2e \
--bs-hl-color eba0ac \
--text-color 11111b \
--text-caps-lock-color 11111b \
--line-color 00000000 \
--line-ver-color 00000000 \
--line-wrong-color 00000000 \
--line-clear-color 00000000 \
--separator-color 00000000 \
--inside-color 285577ff \
--inside-ver-color 89b4fa\
--inside-wrong-color f38ba8 \
--inside-clear-color a6e3a1 \
--color 1e1e2e80 \
$lockargs
# cleanup
rm -f /tmp/swaylock*.png