os/pkgs/swaylock-bg.nix
Benjamin Bädorf 4c0991c7e1
Put always hibernate behind a flag
Hibernation is now a core option:
```
pub-solar.core.hibernation.enable = true;
```

And there's a paranoia mode, that keeps the disk encrypted as much as
possible by enabling hibernation and removing the options for sleep,
screen locking.

Idle locking now hibernates, and it does it on very short notice.
2022-08-14 17:10:30 +02:00

21 lines
463 B
Nix

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
''