dotfiles/bin/periodic_screenshot.sh

14 lines
368 B
Bash
Raw Normal View History

2021-05-23 17:22:46 +02:00
#!/usr/bin/env nix-shell
#!nix-shell -p bash -i bash grim libwebp
2016-01-31 18:17:44 +01:00
2021-05-23 17:22:46 +02:00
mkdir -p ~/periodic_screenshot
while true; do
format="%Y-%m-%d_%H-%M_$(hostname).webp"
2016-01-31 18:17:44 +01:00
2021-05-23 17:22:46 +02:00
if [[ $(pidof sway) -gt 0 ]]; then
WAYLAND_DISPLAY=wayland-0 grim -c -t ppm /dev/stdout | cwebp -near_lossless 60 -progress -o ~/periodic_screenshot/$(date +$format) -- -
fi
sleep 2m
done
2016-01-31 18:17:44 +01:00