dotfiles/.local/bin/scripts/record-slurp
2025-07-20 12:57:27 -04:00

15 lines
437 B
Bash
Executable file

#!/bin/bash
# Check if wl-screenrec is running and stop it if it is
pgrep -x "wl-screenrec" && pkill -INT -x wl-screenrec && notify-send -h string:wl-screenrec:record -t 1000 "Finished Recording" && exit 0
area=$(slurp)
for i in 3 2 1; do
notify-send -t 1000 "Recording starts in $i..."
sleep 1
done
# Start recording
dateTime=$(date +%Y-%m-%dT%H:%M:%S)
wl-screenrec --codec av1 --low-power=off -g "$area" -f $HOME/$dateTime.mp4