record script: fix idk

This commit is contained in:
end-4 2024-01-20 14:54:06 +07:00
parent 34622f29cf
commit 6dfd95eecc

View file

@ -5,7 +5,10 @@ getdate() {
}
cd ~/Videos || exit
if [[ "$(pidof wf-recorder)" == "" ]]; then
if pgrep wf-recorder > /dev/null; then
kill --signal SIGINT wf-recorder
notify-send "Recording Stopped" "Stopped" -a 'record-script.sh'
else
notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'record-script.sh'
if [[ "$1" == "--sound" ]]; then
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor & disown
@ -16,7 +19,4 @@ if [[ "$(pidof wf-recorder)" == "" ]]; then
else
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" & disown
fi
else
kill --signal SIGINT wf-recorder
notify-send "Recording Stopped" "Stopped" -a 'record-script.sh'
fi