Improved screenrec

This commit is contained in:
oitsjustjose 2026-06-30 19:56:01 -05:00
commit 0880e89610
2 changed files with 7 additions and 4 deletions

View file

@ -8,15 +8,18 @@ if [[ "$pid" ]]; then
kill -9 "$pid" kill -9 "$pid"
else else
filename="/home/jose/Pictures/Screenshots/$(date '+%Y-%m-%d_%I:%M:%S%p')" filename="/home/jose/Pictures/Screenshots/$(date '+%Y-%m-%d_%I:%M:%S%p')"
notify-send -t 2000 -a Screen Recording 'Starting Screen Recording..'
# Start the screen recording in the region defined by Slurp # Start the screen recording in the region defined by Slurp
wf-recorder -g "$(slurp -b '#00000090')" -f "$filename.mkv" screen_region=$(slurp -b '#00000090')
# Now that we've shown the area, play the screenrec sound as a trigger
paplay $(dirname "$(realpath $0)")/screenrec.wav
# Finally start recording
wf-recorder -g "$screen_region" -f "$filename.mkv"
# Convert to MP4 - mp4 breaks if you kill-9 it, but mkv doesn't. Keep benefits of both # Convert to MP4 - mp4 breaks if you kill-9 it, but mkv doesn't. Keep benefits of both
ffmpeg -i "$filename.mkv" -codec copy "$filename.mp4" && rm "$filename.mkv" ffmpeg -i "$filename.mkv" -codec copy "$filename.mp4" && rm "$filename.mkv"
# Copy the output file to the clipboard # Copy the output file to the clipboard
wl-copy file://"$filename.mp4" -t text/uri-list wl-copy file://"$filename.mp4" -t text/uri-list
# Now we can say the recording is done # Now we can say the recording is done - replace the existing notif
notify-send -t 2000 -a Screen Recording 'Screen Recording Saved!' notify-send -a 'Screen Recording' 'Screen Recording Saved!'
fi fi

BIN
linux/screenrec.wav Normal file

Binary file not shown.