Add upload feature

This commit is contained in:
oitsjustjose 2026-07-04 12:11:07 -05:00
commit c4b83aae54
2 changed files with 89 additions and 3 deletions

View file

@ -9,9 +9,13 @@ if [[ "$pid" ]]; then
else
filename="/home/jose/Pictures/Screenshots/$(date '+%Y-%m-%d_%I:%M:%S%p')"
# Start the screen recording in the region defined by Slurp
screen_region=$(slurp -b '#00000090')
# If you hit cancel the slurp, we need to handle that.
if ! screen_region=$(slurp -b '#00000090'); then
notify-send -a 'Screen Recording' 'Cancelled!'
exit 0
fi
# Now that we've shown the area, play the screenrec sound as a trigger
paplay $(dirname "$(realpath $0)")/screenrec.wav
paplay $(dirname "$(realpath $0)")/screenrec.wav --volume 655350
# 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
@ -19,7 +23,7 @@ else
# Copy the output file to the clipboard
wl-copy file://"$filename.mp4" -t text/uri-list
# Now we can say the recording is done - replace the existing notif
notify-send -a 'Screen Recording' 'Screen Recording Saved!'
notify-send -a 'Screen Recording' 'Saved + Copied to Clipboard'
fi