2023-01-28 20:49:10 +00:00
|
|
|
self:
|
|
|
|
with self; ''
|
2021-05-30 19:10:28 +00:00
|
|
|
# Dependencies:
|
|
|
|
# swaylock
|
|
|
|
|
|
|
|
# Make sure we aren't running twice
|
2022-09-01 12:37:14 +00:00
|
|
|
RUNNING=$(${procps}/bin/pgrep -c ${swaylock}/bin/swaylock)
|
|
|
|
if [ "$RUNNING" -ne 0 ]; then
|
2021-05-30 19:10:28 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2022-09-01 12:37:14 +00:00
|
|
|
IMAGE="$XDG_CONFIG_HOME/wallpaper.jpg"
|
2021-05-30 19:10:28 +00:00
|
|
|
LOCKARGS=""
|
|
|
|
|
2022-09-01 12:37:14 +00:00
|
|
|
for OUTPUT in $(${sway}/bin/swaymsg -t get_outputs | ${jq}/bin/jq -r '.[].name')
|
2021-05-30 19:10:28 +00:00
|
|
|
do
|
|
|
|
LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}"
|
|
|
|
done
|
2023-11-11 14:43:09 +00:00
|
|
|
exec ${swaylock}/bin/swaylock --daemonize $LOCKARGS
|
2021-05-30 19:10:28 +00:00
|
|
|
''
|