From 742d138bf60d990378ec6d47471becdacff58b1d Mon Sep 17 00:00:00 2001 From: speedie Date: Mon, 20 Mar 2023 16:47:26 +0100 Subject: [PATCH] disable notifs if recording --- src/speedwm-dfmpeg | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/speedwm-dfmpeg b/src/speedwm-dfmpeg index b147d44..ccb23ad 100755 --- a/src/speedwm-dfmpeg +++ b/src/speedwm-dfmpeg @@ -100,10 +100,21 @@ MORE_OPTIONS() { case "$(printf 'Start\nStop\nStart without audio\nPlay last\n------\nMore options\nAbout\nExit' | $RUNLAUNCHER -l 40 -p 'Record your screen:')" in "Exit") STATUS=idle && exit 0 ;; "Start") touch /tmp/isaudio ; echo "$OUTPUT_FILENAME" > /tmp/outputfilename && STATUS=recording && touch /tmp/dfmpeg-recording - $startrec && exit 0 ;; - "Stop") pkill -x ffmpeg ; rm /tmp/dfmpeg-recording ; STATUS=idle ;; - "Start without audio") echo "$OUTPUT_FILENAME" > /tmp/outputfilename && STATUS=recording && touch /tmp/dfmpeg-recording - $startrec_no_audio && exit 0 ;; + $startrec + pidof dunst > /dev/null && command -v dunstctl > /dev/null && dunstctl set-paused true + + exit 0 ;; + "Stop") [ ! -e /tmp/dfmpeg-recording ] && exit 1 + pkill -x ffmpeg ; rm /tmp/dfmpeg-recording + pidof dunst > /dev/null && command -v dunstctl > /dev/null && dunstctl set-paused false + STATUS=idle + ;; + "Start without audio") + echo "$OUTPUT_FILENAME" > /tmp/outputfilename && STATUS=recording && touch /tmp/dfmpeg-recording + pidof dunst > /dev/null && command -v dunstctl > /dev/null && dunstctl set-paused true + $startrec_no_audio + exit 0 + ;; "Play last") DFMPEG_STATUS=idle && $MEDIA_PLAYER "$(cat /tmp/outputfilename)" && exit 0 ;; "More options") MORE_OPTIONS && exit 0 ;; "") exit 0 ;;