Better extraction

This commit is contained in:
David Heinemeier Hansson
2025-07-19 22:43:28 -05:00
parent 81727a20ce
commit df13763d42

View File

@ -1,21 +1,20 @@
#!/bin/bash #!/bin/bash
screenrecording() { screenrecording() {
notify-send "Screen recording starting..." -t 1000
sleep 1
wl-screenrec \ wl-screenrec \
-f "$HOME/Videos/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4" \ -f "$HOME/Videos/screenrecording-$(date +'%Y-%m-%d_%H-%M-%S').mp4" \
--ffmpeg-encoder-options="-c:v libx264 -crf 23 -preset medium -movflags +faststart" --ffmpeg-encoder-options="-c:v libx264 -crf 23 -preset medium -movflags +faststart" \
"$@"
} }
if pgrep -x wl-screenrec >/dev/null; then if pgrep -x wl-screenrec >/dev/null; then
pkill -x wl-screenrec pkill -x wl-screenrec
notify-send "Screen recording saved to ~/Videos" -t 2000 notify-send "Screen recording saved to ~/Videos" -t 2000
elif [[ $1 == "output" ]]; then elif [[ "$1" == "output" ]]; then
notify-send "Screen recording starting..." -t 1000
sleep 1
screenrecording -o "" screenrecording -o ""
else else
region=$(slurp) || exit 1 region=$(slurp) || exit 1
notify-send "Screen recording starting..." -t 1000
sleep 1
screenrecording -g "$region" screenrecording -g "$region"
fi fi