mirror of
https://github.com/LukeHagar/omarchy.git
synced 2025-12-07 20:47:49 +00:00
Add error explanation if we have to kill
This commit is contained in:
@@ -69,16 +69,21 @@ start_screenrecording() {
|
|||||||
stop_screenrecording() {
|
stop_screenrecording() {
|
||||||
pkill -SIGINT -f "gpu-screen-recorder" # SIGINT required to save video properly
|
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
|
local count=0
|
||||||
while pgrep -f "gpu-screen-recorder" >/dev/null && [ $count -lt 50 ]; do
|
while pgrep -f "gpu-screen-recorder" >/dev/null && [ $count -lt 50 ]; do
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
count=$((count + 1))
|
count=$((count + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
pgrep -f "gpu-screen-recorder" >/dev/null && pkill -9 -f "gpu-screen-recorder"
|
if pgrep -f "gpu-screen-recorder" >/dev/null; then
|
||||||
cleanup_webcam
|
pkill -9 -f "gpu-screen-recorder"
|
||||||
|
cleanup_webcam
|
||||||
notify-send "Screen recording saved to $OUTPUT_DIR" -t 2000
|
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
|
toggle_screenrecording_indicator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user