feat: Add Theme Scheduler with auto sunrise/sunset and fixed time modes#5809
Open
Harshil-Anuwadia wants to merge 1 commit into
Open
feat: Add Theme Scheduler with auto sunrise/sunset and fixed time modes#5809Harshil-Anuwadia wants to merge 1 commit into
Harshil-Anuwadia wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a systemd user timer/service and migration to support an automated theme scheduler (fixed times or sunrise/sunset) that runs periodically in the background.
Changes:
- Adds a user-level systemd timer to run the scheduler periodically.
- Adds a user-level systemd oneshot service that executes the scheduler and appends logs to a file.
- Adds a migration to auto-enable the timer for existing users when the unit is present.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| migrations/1778733053.sh | Enables/starts the new user timer during migration. |
| config/systemd/user/omarchy-theme-schedule.timer | Defines the periodic schedule for theme checks. |
| config/systemd/user/omarchy-theme-schedule.service | Runs the scheduler script and configures environment/logging. |
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStartPre=/usr/bin/systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE |
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStartPre=/usr/bin/systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP HYPRLAND_INSTANCE_SIGNATURE |
|
|
||
| # Enable the theme scheduler timer if it was recently added | ||
| if [[ -f "$HOME/.config/systemd/user/omarchy-theme-schedule.timer" ]]; then | ||
| systemctl --user enable --now omarchy-theme-schedule.timer || true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Add automated theme scheduler (Time & Sunrise/Sunset)
Description
This PR adds a new feature that lets users automatically switch between light and dark themes. It can run on a fixed schedule or automatically follow local sunrise and sunset times.
I integrated it directly into the Setup section of
omarchy-menu, so no manual config editing is needed.Features
wttr.in(same as the weather widget) to automatically trigger theme changes at local sunrise and sunset.HH:MMtimes for day and night.Technical Details & Fixes
/tmp/omarchy-theme-schedule.lock.dir). Initially, I tried file locks (flock), but child processes likewaybarkept inheriting the file descriptor and causing the script to hang. Directory locks completely solved this.WAYLAND_DISPLAYandHYPRLAND_INSTANCE_SIGNATUREso the theme commands run correctly from a background context.waybarinstances if they accidentally spawn during a transition.Files Added/Modified
bin/omarchy-theme-schedule(Core script)bin/omarchy-menu(Integrated into setup menu)config/systemd/user/omarchy-theme-schedule.timerconfig/systemd/user/omarchy-theme-schedule.servicemigrations/1778733053.sh(Auto-enables the timer for existing users)