Repository navigation
Gate screensaver launches on window class and pidof -x - #10260
fresh3nough wants to merge 3 commits into
Conversation
|
Thanks for picking this up. I reproduced this in Arch Linux with an executable named The current test replaces The issue’s Hyprland-window check avoids both the original argv false positive and the 15-character process-name limit. I would also include hyprctl clients -j 2>/dev/null \
| jq -e 'any(.[]; .class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver")' >/dev/null \
&& exit 0A regression should exercise the real window-state predicate rather than a mocked |
chessing234
left a comment
There was a problem hiding this comment.
pgrep -x fix directly addresses the false-positive early exit.
|
Reviewed by Claude Opus 5 in Claude Code, with an independent second opinion from Codex at xhigh reasoning. Everything below was run on a disposable Omarchy 4.0.0 worker VM with a real compositor, never on the review host. The new gate can never matchThis confirms, with measurements, what arisgysel-design already reported above: On the worker (procps-ng 4.0.7) with a real screensaver up on foot: The process you picked is the right one — That makes this a regression rather than a fix. The old Two stacked screensaver terminals, per monitor. Secondary: The test cannot catch this, by construction
Smaller things in the same file:
Not pushing a fixMaking the gate work means replacing the mechanism, and that takes most of the test file with it. That is your PR to shape rather than something to land over your name without asking. Two directions that work: The window check from #10197, which this repo already uses verbatim at hyprctl clients -j 2>/dev/null |
jq -e 'any(.[]; .class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver")' >/dev/null && exit 0Or keep a process gate and give the process a name short enough to survive the truncation. #6813 does exactly that — Either way, the regression test should drive the real predicate rather than a stub, or it will keep passing on a gate that cannot fire. Out of scope here, but adjacentThe same argv-collision class survives in two places that kill rather than skip: What ran
Codex agreed with the truncation finding and with the test's stub gap; both were written down before it ran, so its independence there is not guaranteed. It contributed the two Waiting on you. |
|
Implemented the requested follow-up on top of this PR in
Local gates: focused test 4/4, bin-style 2/2, The PR head belongs to |
|
Re-reviewed at b17b784, unchanged since the last pass. The finding from that pass stands, and I re-proved it from scratch on a disposable Arch worker (kernel 7.1.9-arch1-2, procps-ng 4.0.7) rather than carry it forward on trust. The gate cannot fire
procps refuses a
Rows 3 and 4 are correct in all three states. Row 2 fixes the middle column and breaks the one that matters. Running this branch's launcher against a screensaver that was already up: So the branch as it stands cannot close #10197 — it replaces a silent no-op with duplicate stacked screensavers, one per monitor per invocation. Secondary: The test still cannot catch itUnchanged since the last pass, so briefly: Where I would take itNot pushing anything: replacing the mechanism takes most of the test file with it, and that is yours to shape. Codex found a failure mode in the window check that I had not reasoned about, and it changes the shape of the answer. The predicate that covers every column above is the one this repo already has at hyprctl clients -j 2>/dev/null |
jq -e 'any(.[]; .class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver")' >/dev/null && exit 0
pidof -x omarchy-screensaver >/dev/null && exit 0
A third route: #6813 writes Whichever you pick, the regression test needs to drive the real predicate rather than a stub, or it will keep passing on a gate that cannot fire. The fork commitI read @arisgysel-design's comment. That commit is not on this branch, so it does not change what I can say about this one, and I did not fetch or run it. The diagnosis in their earlier comment matches what I measured independently here. What ranOn a disposable worker with a real compositor: the probes above; Reviewed by Claude Opus 5, with a second opinion from Codex (gpt-5.6-sol) at xhigh reasoning. Codex agreed with the truncation finding and with the test's blind spot, but both were written down before it ran, so its independence there is not guaranteed. The Waiting on you. |
b17b784 to
46c4e3e
Compare
|
Addressed #10260 (comment). Rebased onto current What was wrong
What it does now hyprctl clients -j 2>/dev/null |
jq -e 'any(.[]; .class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver")' >/dev/null && exit 0
pidof -x omarchy-screensaver >/dev/null 2>&1 && exit 0Window first for a mapped client, then Tests
Only Commit is DCO-signed ( |
pgrep -f against the app-id false-positives on unrelated argv (#10197). pgrep -x omarchy-screensaver can never match either: the script name is 19 characters, Linux truncates comm to 15, and procps refuses the pattern, so every force launch stacked another fullscreen window. Use the Hyprland class / initialClass check first, then pidof -x for the interval where hypr_exec has started the script but openwindow has not mapped yet. pidof -x is required; plain pidof misses a bash script. Rewrite the regression test to drive the real jq and pidof predicates with only hyprctl stubbed, covering mapped windows, decoy argv, and a live long-named script process. Fixes #10197 Signed-off-by: fresh3nough <anonwurcod@proton.me>
46c4e3e to
1b461df
Compare
|
Rebased onto current
Focused |
|
One more case this fixes: the current Combined with the |
The launcher now gates on a mapped screensaver window and pidof -x, so the fixture's pgrep stub no longer isolates it, and a screensaver client returned before anything spawned makes the gate exit before the first monitor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-reviewed at 1b461df, now 867031f with the two commits below, by Claude Opus 5.5, with a second opinion from Codex at medium effort. Everything below ran on a disposable Omarchy worker with a real compositor (procps-ng 4.0.7, one monitor), never on the review host. The gate worksThe bug reproduces on
So the class check plus Pushed:
|
|
| hyprctl clients -j 2>/dev/null | | ||
| jq -e 'any(.[]; .class == "org.omarchy.screensaver" or .initialClass == "org.omarchy.screensaver")' >/dev/null && exit 0 | ||
| pidof -x omarchy-screensaver >/dev/null 2>&1 && exit 0 |
There was a problem hiding this comment.
Concurrent launches can stack screensavers
If a second launch starts after the first dispatches its terminal but before that terminal opens a window or starts omarchy-screensaver, both checks find nothing. A menu force launch can then dispatch another fullscreen screensaver. The first launcher's wait for the window does not prevent the second launch.
Summary
omarchy-launch-screensaverdecided a screensaver was already running with:pgrep -fmatches the full command line of every process. Any unrelated process whose argv containedorg.omarchy.screensavermade the launcher exit 0 with no output and no screensaver. Idle logging then looked healthy. Real hit:nwg-dock-hyprland -g 'org.omarchy.screensaver'(see #10197).An earlier revision of this PR used
pgrep -x omarchy-screensaver. That can never match: the script name is 19 characters, Linux truncatescommto 15, and procps refuses the pattern — everyforcelaunch stacked another fullscreen window.Current gate:
Window first for a mapped client, then
pidof -xfor thehypr_exec/openwindowinterval. Plainpidofmisses a bash script;-xis required. Terminal--class/--app-idare unchanged for Hyprland rules.Fixes #10197
Test plan
bash test/shell.d/launch-screensaver-test.sh(7/7)pgrepforms; requires class check +pidof -xclass/initialClassexit 0 before helperspidof -xor the launcherpidof -x(and not bypgrep -x)