dotfiles/de/home/.local/bin/sp-lock
2024-04-29 15:58:34 -06:00

16 lines
556 B
Bash
Executable file

#!/bin/bash
source "${HOME}/.local/lib/sp-functions"
outputs=( $(swaymsg -t get_outputs | jq -r '.[] | {name} | "\(.name)"') )
for o in ${outputs[@]};do
workspace=$(swaymsg -t get_workspaces | jq -r '.[] | select(.output) | {name} | "\(.name)"')
wpno=$(cat "${cache_dir}/displays/${o}")
wp_imgpath="$HOME/.config/sway/assets/wallpaper/${o}/${wpno}.jpg"
sl_imgpath="${cache_dir}/lock/${o}.jpg"
convert -scale 10% -blur 0x3 -resize 500% "${wp_imgpath}" "${sl_imgpath}"
sl_args="${sl_args}--image ${o}:${sl_imgpath} "
done
swaylock ${sl_args}