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