os/pkgs/swaylock-bg.nix

21 lines
463 B
Nix
Raw Normal View History

2021-05-30 19:10:28 +00:00
self: with self; ''
# Dependencies:
# swaylock
# Make sure we aren't running twice
RUNNING=$(ps -A | grep swaylock | wc -l)
if [ $RUNNING -ne 0 ]; then
exit 0
fi
IMAGE=$XDG_CONFIG_HOME/wallpaper.jpg
LOCKARGS=""
for OUTPUT in `${sway}/bin/swaymsg -t get_outputs | jq -r '.[].name'`
do
LOCKARGS="''${LOCKARGS} --image ''${OUTPUT}:''${IMAGE}"
IMAGES="''${IMAGES} ''${IMAGE}"
done
exec ${swaylock}/bin/swaylock $LOCKARGS
''