Skip to content

Skip the nightlight toggle's wait when hyprsunset is already running - #15035

Merged
dhh merged 2 commits into
quattrofrom
nightlight-toggle-no-fixed-sleep
Oct 12, 2026
Merged

dhh merged 2 commits into
quattrofrom
nightlight-toggle-no-fixed-sleep

Conversation

@dhh

@dhh dhh commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

omarchy-toggle-nightlight always slept 200ms after setting the temperature before checking that it stuck. The wait exists because a freshly started hyprsunset applies its boot default at the end of startup and overrides anything set before then. One that was already running applies the change at once.

The toggle now remembers whether it just started hyprsunset. If not, it checks right after setting and stops there; the fresh-start path keeps the original resend-and-wait loop.

Measured on a running desktop: a toggle with hyprsunset running took 240ms before and 36ms after. A toggle that starts hyprsunset still takes ~450ms and lands on the right temperature. nightlight-test.sh covers both paths with a stubbed sleep.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are addressed and no new blocking issues were found.

Summary

The nightlight toggle skips its wait for an established hyprsunset process.

  • Settled nightlight toggles check the new temperature without waiting.

Reviews (2) · Last reviewed commit: "Wait on a hyprsunset that is still start..." · Reviewed by Greptile

Comment thread bin/omarchy-toggle-nightlight Resolved
Comment thread test/shell.d/nightlight-test.sh Resolved
…started

Addresses Greptile review: one launched at login and toggled mid-boot could accept the temperature and then apply its boot default over it. The tests now simulate that default instead of only checking for a sleep.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhh
dhh merged commit ea41263 into quattro Oct 12, 2026
1 check passed
@dhh
dhh deleted the nightlight-toggle-no-fixed-sleep branch October 12, 2026 13:50
@dhh
dhh restored the nightlight-toggle-no-fixed-sleep branch October 12, 2026 13:50
omarchybot added a commit to manuaudio/omarchy that referenced this pull request Oct 15, 2026
The loop's comment, from omacom#15035, says why a hyprsunset still starting needs the resend even once its socket answers: it applies its boot default after accepting a temperature. The rewrite in this branch described only an unopened socket, which loses the reason a process under three seconds old counts as starting, and is unrelated to scoping the lookup to this user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
omarchybot added a commit that referenced this pull request Oct 16, 2026
Keeps both sets of nightlight tests: the identity and default-temperature cases from this branch, and the hyprsunset boot-wait cases from #15035. The toggle script merged cleanly, so off still resends until the temperature sticks and then resets to identity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
omarchybot added a commit to yashranaway/omarchy that referenced this pull request Nov 2, 2026
quattro (omacom#16334) removed the source-text check that sat beside this branch's new test, and (omacom#15035, omacom#14489) added the boot-wait and identity-reset tests above it; the resolution keeps quattro's file and appends this branch's detached-daemon test after them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants