From a7a6ac1d217749643fbae6060d7014c01e4c051b Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sat, 11 Oct 2025 01:25:44 -0400 Subject: [PATCH] Add error explanation if we have to kill --- bin/omarchy-cmd-screenrecord | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/omarchy-cmd-screenrecord b/bin/omarchy-cmd-screenrecord index 62bf951d..0ea1e513 100755 --- a/bin/omarchy-cmd-screenrecord +++ b/bin/omarchy-cmd-screenrecord @@ -69,16 +69,21 @@ start_screenrecording() { stop_screenrecording() { pkill -SIGINT -f "gpu-screen-recorder" # SIGINT required to save video properly + # Wait a maximum of 5 seconds to finish before hard killing local count=0 while pgrep -f "gpu-screen-recorder" >/dev/null && [ $count -lt 50 ]; do sleep 0.1 count=$((count + 1)) done - pgrep -f "gpu-screen-recorder" >/dev/null && pkill -9 -f "gpu-screen-recorder" - cleanup_webcam - - notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000 + if pgrep -f "gpu-screen-recorder" >/dev/null; then + pkill -9 -f "gpu-screen-recorder" + cleanup_webcam + notify-send "Screen recording error" "Recording process had to be force-killed. Video may be corrupted." -u critical -t 5000 + else + cleanup_webcam + notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000 + fi toggle_screenrecording_indicator }