nixos-configs/nixosModules/ags/config/widgets/screenshot/capture.sh
matt1432 4e6e73a213
All checks were successful
Discord / discord commits (push) Has been skipped
feat(ags): add freeze option for screenshot
2024-11-19 22:05:12 -05:00

18 lines
330 B
Bash
Executable file

#!/usr/bin/env bash
if [[ "$1" == "region" ]]; then
if [[ "$2" == "true" ]]; then
wayfreeze & PID=$!
sleep .1
fi
selection="$(slurp)"
if [[ "$2" == "true" ]]; then
kill "$PID"
fi
exec grim -g "$selection" - | satty -f - || true
else
exec grim "$@" - | satty -f - || true
fi