#!/bin/bash mkdir -p ~/Videos statecon=$( pidof wf-recorder ) if [ "$statecon" == '' ]; then rm ~/Videos/lastrec.mp4 notify-send "recording started" wf-recorder -g "$(slurp)" -a -f ~/Videos/lastrec.mp4 else notify-send "recording ended" killall -s SIGINT wf-recorder wl-copy < ~/Videos/lastrec.mp4 fi