Add automatic time-based nightlight schedule with TUI manager#5928
Add automatic time-based nightlight schedule with TUI manager#5928mplaczek99 wants to merge 6 commits into
Conversation
Replaces the Nightlight entry in the toggle menu with a gum-based TUI that manages an opt-in, time-based hyprsunset schedule. Users can enable/disable the schedule and set intensity (temperature), start time, and end time. The existing manual SUPER+CTRL+N keybinding and 'omarchy toggle nightlight' command are unchanged. When enabled, the schedule writes the user's chosen warm and identity profiles to ~/.config/hypr/hyprsunset.conf and adds hyprsunset to autostart (supports both autostart.lua and pre-migration autostart.conf). When disabled, hyprsunset.conf is restored to the Omarchy default and the autostart entry is removed. Settings persist in ~/.local/state/omarchy/nightlight-schedule.conf and the enabled flag at ~/.local/state/omarchy/toggles/nightlight-schedule. Defaults are off, 4000K, 20:00 to 07:00.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds an automatic, time-based nightlight schedule to Hyprland via hyprsunset, including a gum-powered TUI and new CLI entrypoints to enable/disable and configure the schedule.
Changes:
- Introduces
omarchy-nightlight-scheduleto store schedule state, writehyprsunset.conf, and manage autostart + apply/revert behavior. - Adds an interactive TUI (
omarchy-tui-nightlight) and a toggle wrapper (omarchy-toggle-nightlight-schedule). - Updates menu + config guidance to point users to the new schedule workflow.
Reviewed changes
Copilot reviewed 1 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| config/hypr/hyprsunset.conf | Updates user-facing guidance for enabling/configuring the nightlight schedule. |
| bin/omarchy-tui-nightlight | New interactive TUI for configuring and toggling the schedule. |
| bin/omarchy-toggle-nightlight-schedule | New wrapper command to toggle the schedule. |
| bin/omarchy-nightlight-schedule | Core schedule manager: persists state, writes hyprsunset profiles, adjusts autostart, applies changes. |
| bin/omarchy-menu | Routes “Nightlight” toggle menu entry to the new TUI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # For an automatic time-based schedule, open Trigger > Toggle > Nightlight in | ||
| # the Omarchy menu (or run: omarchy toggle nightlight-schedule). The menu lets | ||
| # you set the intensity and start/end times; the schedule writes profiles here | ||
| # and adds hyprsunset to autostart. | ||
| # | ||
| # To schedule by hand instead, add to ~/.config/hypr/autostart.lua: | ||
| # o.launch_on_start("hyprsunset") | ||
| # and append a profile block here: |
There was a problem hiding this comment.
You get to the Toggle menu by going through the Trigger menu first. It is: Trigger > Toggle
Replaces the manual temperature toggle bound to SUPER+CTRL+N with a launch of omarchy-tui-nightlight, matching the Trigger > Toggle > Nightlight menu entry. omarchy-toggle-nightlight is still available from the CLI for users who script it.
|
I think that we should consider moving Nightlight from Trigger > Toggle > Nightlight to another area in the Omarchy Menu. But where? |
… notifications Removes bin/omarchy-toggle-nightlight. The schedule's enable/disable covers turning the warm tint on and off; the standalone temperature toggle is redundant now that the menu, keybinding, and CLI all route through the schedule. Backs up the user's pre-enable ~/.config/hypr/hyprsunset.conf to ~/.local/state/omarchy/hyprsunset.preauto.conf on first enable and restores from it on disable. Falls back to the Omarchy default when no backup is present, so a wiped state still recovers cleanly. Avoids the data-loss risk of clobbering a customized hyprsunset.conf. Replaces the stale 'Auto-nightlight enabled/disabled' notification strings with 'Nightlight enabled/disabled' plus the moon glyph, matching the menu wording and other omarchy toggle notifications. Updates the SKILL.md example from 'omarchy toggle nightlight' (now gone) to the new TUI command, and swaps the generic toggle-group example to 'omarchy toggle screensaver'.
I was missing a hypen in omarchy nightlight to be omarchy-nightlight Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
The previous comment implied 'omarchy toggle nightlight-schedule' opened a configuration menu, but the toggle wrapper only flips the schedule on/off. Direct users to 'omarchy tui nightlight' for interactive config and keep the toggle command as a separate, on/off-only entry.
|
It's an interesting idea, but I think it's too much code. I also don't think a fixed time frame is going to be right in most places. Would need something that tracks sunrise/sunset. I think this would be best explored in an external AUR package. Thanks for looking at this! |
Fixes #5929.
Summary
SUPER+CTRL+Nkeybinding at the TUIomarchy toggle nightlight(redundant with the schedule's enable/disable)hyprsunset.confis preserved and restored on disableWhat changes
Both the Trigger → Toggle → Nightlight entry and the
SUPER+CTRL+Nkeybinding now open a floating terminal runningomarchy-tui-nightlight. The TUI shows current status, intensity (K), and the start/end times, and lets the user:HH:MMinputWhen enabled, the schedule writes the chosen warm + identity profiles to
~/.config/hypr/hyprsunset.confand addshyprsunsetto autostart. Both the post-Lua-migrationautostart.luaand the pre-migrationautostart.confformats are supported. The user's pre-enablehyprsunset.confis copied to~/.local/state/omarchy/hyprsunset.preauto.confso a customized config isn't lost — on disable it's moved back into place; if no backup is present (state wiped, fresh install) the Omarchy default is used as a fallback. The autostart entry is removed on disable.State lives in:
~/.local/state/omarchy/toggles/nightlight-schedule— enabled flag~/.local/state/omarchy/nightlight-schedule.conf—TEMPERATURE,START_TIME,END_TIME~/.local/state/omarchy/hyprsunset.preauto.conf— backup of the user's pre-enable config (transient; removed on disable)Defaults: disabled, 4000K, 20:00 → 07:00.
New commands
omarchy tui nightlightSUPER+CTRL+N)omarchy nightlight schedule status|enable|disable|toggle|applyomarchy nightlight schedule set-intensity <K>omarchy nightlight schedule set-start <HH:MM>/set-end <HH:MM>omarchy toggle nightlight-scheduleRemoved
omarchy-toggle-nightlight(the standalone manual 4000K ↔ 6000K toggle). Anything that used to call it should now useomarchy nightlight schedule enable/disable, or open the TUI.Test plan
SUPER+CTRL+Nopens the TUI; panel shows defaults (Disabled · 4000K · 20:00 · 07:00) on first launchhyprsunset.confis copied to~/.local/state/omarchy/hyprsunset.preauto.conf; live config is replaced with managed content; autostart line is added;hyprsunsetstartshyprsunset.confre-renders with new valueshyprsunset.confis restored from the backup, backup is removed, autostart line stripped,hyprsunsetkilledhyprsunset.confhyprsunsetautostarts and schedule is activeomarchy commandslists the new routes;bash test/omarchy-cli-test.shstill green