From b7669156ef809f93d7715a63342ae3da0b7abe38 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 11 May 2026 23:35:44 +0000 Subject: [PATCH] fix(eww): background the capture command to survive eww onclick timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The eww source confirms run_command has a hardcoded 200ms timeout (crates/eww/src/widgets/mod.rs) — after which it SIGKILLs the onclick child. Because /bin/sh -c "single-command" execs directly into the command without an intermediate sh, the kill lands on the stoa-capture script itself. Recording survived only because wf-recorder is forked with `&` well within the 200ms window. Screenshot died mid-sleep before _screenshot ever ran (the debug log shows no entries after the "Case selection/screen/window triggered" line). `setsid -f` failed silently (likely not on PATH for the /bin/sh eww spawns, or itself killed by the timeout before forking), so no entries appeared at all on the latest attempt. Wrap the invocation in `( ... /dev/null 2>&1 &)` so /bin/sh forks a subshell that immediately backgrounds stoa-capture and exits. The whole sh invocation returns in microseconds, eww's timeout never fires, and stoa-capture continues as an orphaned process — sleep 0.5 and grim now complete normally. --- config/eww/eww.yuck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/eww/eww.yuck b/config/eww/eww.yuck index 7bde937..46b5c8c 100644 --- a/config/eww/eww.yuck +++ b/config/eww/eww.yuck @@ -136,7 +136,7 @@ ;; Capture button (button :class {capture-type == "screenshot" ? "cap-shutter-btn" : "cap-shutter-btn recording"} - :onclick "setsid -f stoa-capture ${capture-mode} ${capture-type} ${capture-delay}" + :onclick "(stoa-capture ${capture-mode} ${capture-type} ${capture-delay} /dev/null 2>&1 &)" (label :class "cap-shutter-icon" :text {capture-type == "screenshot" ? "●" : "●"}))