Files
omarchy/bin/omarchy-screenrecord

21 lines
538 B
Plaintext
Raw Normal View History

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