blob: a271a8033331763222e535da4f8da4c4b18b26a5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/bin/sh
XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
if pgrep wf-recorder; then
filename=$(cat $XDG_CACHE_HOME/recorded_filename)
killall -s SIGINT wf-recorder
notify-send "Recording Complete"
while [ ! -z $(pgrep -x wf-recorder) ]; do wait; done
pkill -RTMIN+8 waybar
ffmpeg -i "$HOME/Videos/$filename.mkv" -c:v libx264rgb -c:a aac "$HOME/Videos/$filename.mp4" &
else
filename=$(date +%F_%T)
echo $filename > $XDG_CACHE_HOME/recorded_filename
notify-send "Recording Started"
if [ "$1" == "-s" ]
then wf-recorder --codec libx264rgb -f "$HOME/Videos/$filename.mkv" --audio=alsa_output.pci-0000_00_1f.3.analog-stereo.monitor -g "$(slurp || notify-send "Recording Canceled"; exit 1)" >/dev/null &
sleep 2
while [ ! -z $(pgrep -x slurp) ]; do wait; done
pkill -RTMIN+8 waybar
else
wf-recorder --codec libx264rgb -f "$HOME/Videos/$filename.mkv" -a --audio=alsa_output.pci-0000_00_1f.3.analog-stereo.monitor &
pkill -RTMIN+8 waybar
fi
fi
|