Skip to content

Add sunset-based night light scheduling - #9554

Open
gaburn wants to merge 11 commits into
omacom:quattrofrom
gaburn:feature/sunset-nightlight
Open

gaburn wants to merge 11 commits into
omacom:quattrofrom
gaburn:feature/sunset-nightlight

Conversation

@gaburn

@gaburn gaburn commented Sep 1, 2026 •

Copy link
Copy Markdown

What changes

  • Add timezone-aware sunrise and sunset scheduling for Night Light.
  • Add a fixed-position Night Light indicator with a right-click mode panel.
  • Keep manual controls, timezone refreshes, CLI status, menu entries, and documentation in sync.
  • Cover solar calculations, schedule persistence, fixed indicator placement, and panel interactions.

Summary

Night Light
  manual  -> set the display temperature
  sunset  -> selected timezone -> sunrise/sunset -> display temperature

Verification

Evidence

Before: Night Light had no sunset schedule or always-visible mode selector.

After: The isolated shell showed the fixed indicator, opened its mode panel on right-click, and displayed the next solar event.

  • ./test/cli — passed.
  • bash test/shell.d/nightlight-test.sh, bash test/shell.d/nightlight-mode-test.sh, bash test/shell.d/nightlight-probe-test.sh, bash test/shell.d/nightlight-resume-test.sh, bash test/shell.d/nightlight-solar-test.sh — passed.
  • bash test/shell.d/indicator-contract-test.sh, bash test/shell.d/remote-session-test.sh, bash test/shell.d/bar-widget-contract-test.sh, bash test/shell.d/bar-test.sh, bash test/shell.d/bar-click-clipping-test.sh, bash test/shell.d/bar-icon-geometry-test.sh, bash test/shell.d/passwordless-sudo-indicator-test.sh, bash test/shell.d/shell-idle-spawn-test.sh — passed.
  • bash test/shell.d/elsewhen-model-test.sh, bash test/shell.d/qml-text-format-test.sh, bash test/shell.d/menu-guards-test.sh, bash test/shell.d/menu-guard-budget-test.sh — passed.
  • bash test/shell.d/i18n-test.sh — passed; the pending-translation check was skipped in structural mode.

The aggregate shell suite was not rerun for this merge because it includes process-killing commands unsafe in the shared desktop session. Before the merge, its remaining failures required the unavailable sibling omarchy-pkgs checkout (config-test.sh, snapper-test.sh, and unowned-system-paths-test.sh).

Merge Danger

Door: two-way.

Blast Radius: desktop.

Solar mode changes the display temperature; selecting a manual mode or reverting the change restores manual control.

Screenshots

The merged panel was checked in an isolated shell. New before/after captures could not be attached without write access to the base repository. Previous PR screenshot:

Night Light Sunset mode selected

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@cmdrrobin

Copy link
Copy Markdown

This would be a nice addition to Omarchy

Detect wall-clock jumps because Qt countdowns pause during suspend, and evaluate the schedule only after reading the current display temperature.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
gaburn and others added 2 commits September 5, 2026 22:26
Calculate event crossings with the same solar model and second precision as night state. Search neighboring UTC calculation dates so date-line timezones retain today's sunset.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Serialize schedule persistence and ignore intermediate probes so a pending Sunset enable cannot override a newer manual selection. Cover rapid mode reversals and delayed QML process completion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Adds sunset-based Night Light scheduling using the selected system timezone.

  • Night Light can follow sunrise and sunset in the selected timezone.
  • The Night Light indicator stays in place and opens a panel with its modes.

All four previous findings are addressed. No new actionable issues were established. This review used source checks; no runtime or visual verification was performed.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Choose Sunset] --> B[Save solar mode]
  B --> C[Read display temperature]
  C --> D[Calculate current solar state]
  D --> E[Apply warm or daylight display]
  D --> F[Schedule next check]
  E -->|Command fails| G[Delay retry]
  G --> C
  F --> C
  H[Choose manual mode] --> I[Disable solar mode]
  I --> J[Apply selected temperature]
Loading

Reviews (2) · Last reviewed commit: "Wait for Night Light recovery to settle ..." · Reviewed by Greptile

Comment thread test/shell.d/nightlight-mode-test.sh Resolved
gaburn and others added 6 commits November 6, 2026 14:06
A failed apply refreshed the probe immediately and retriggered the schedule. Delay automatic retries while preserving newer manual requests and explicit refresh recovery.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The bar tracked the Indicators widget, not its nested Night Light panel. Forward the panel contract through that widget and remove the unused fixed-position assertion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the Indicators widget as the popup identity so same-section panel transitions, the open marker, and teardown follow the bar contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep solar, probe, mode and resume checks in the existing suite while gating only compositor-dependent fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Select the active child before opening it so indicators sharing a bar owner cannot leave multiple popups open.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Wait for the post-apply probe before queuing the next manual request.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants