From 8e788f624d18e629c4ec67b9b07d1bea5265ebb0 Mon Sep 17 00:00:00 2001 From: The_miro Date: Wed, 18 Feb 2026 11:06:07 +0100 Subject: [PATCH] now the screenrec notif also acts as a button to stop recordin --- desktopenvs/hyprland/scripts/screenrec.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/desktopenvs/hyprland/scripts/screenrec.sh b/desktopenvs/hyprland/scripts/screenrec.sh index b1f6502..80ae028 100755 --- a/desktopenvs/hyprland/scripts/screenrec.sh +++ b/desktopenvs/hyprland/scripts/screenrec.sh @@ -1,19 +1,29 @@ #!/bin/bash + +endrec () { + killall -s SIGINT wf-recorder + dunstctl close $nid + notify-send "recording ended - output to $outfile" +} + mkdir -p ~/Videos statecon=$( pidof wf-recorder ) outfile="$HOME/Videos/$(date +'%Y%m%d%H%M%S').mp4" -$outfile +#$outfile nid="" 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 - dunstctl close $nid - notify-send "recording ended - output to $outfile" - killall -s SIGINT wf-recorder + endrec fi +goto endplace +:endrecplace +endrec +:endplace