now the screenrec notif also acts as a button to stop recordin

main
The_miro 2026-02-18 11:06:07 +01:00
parent fbce22632d
commit 8e788f624d
1 changed files with 16 additions and 6 deletions

View File

@ -1,19 +1,29 @@
#!/bin/bash #!/bin/bash
endrec () {
killall -s SIGINT wf-recorder
dunstctl close $nid
notify-send "recording ended - output to $outfile"
}
mkdir -p ~/Videos mkdir -p ~/Videos
statecon=$( pidof wf-recorder ) statecon=$( pidof wf-recorder )
outfile="$HOME/Videos/$(date +'%Y%m%d%H%M%S').mp4" outfile="$HOME/Videos/$(date +'%Y%m%d%H%M%S').mp4"
$outfile #$outfile
nid="" nid=""
if [ "$statecon" == '' ]; then if [ "$statecon" == '' ]; then
$nid=$(notify-send -p -u critical -t 0 "recording started") wf-recorder -g "$(slurp)" -f $outfile &
wf-recorder -g "$(slurp)" -f $outfile $nid=$(notify-send -p -u critical -t 0 "recording started" --action="goto endrecplace"
)
else else
dunstctl close $nid endrec
notify-send "recording ended - output to $outfile"
killall -s SIGINT wf-recorder
fi fi
goto endplace
:endrecplace
endrec
:endplace