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