Feature: Time-based constraints for dark mode switching#14
Open
antwan wants to merge 5 commits into
Open
Conversation
Introduce time-based scheduling that restricts when the brightness rule applies. Fixed time mode allows setting start/end times — outside the window, light mode is forced. Includes macOS Auto dark mode override to prevent conflicts. https://claude.ai/code/session_01PjA1UeTdCC4ou5JjMzUkjm
Add solar-relative scheduling mode using NOAA equations. Users can set offsets from -4:00 to +4:00 relative to sunset (start) and sunrise (end). Requires location permission for solar calculations. https://claude.ai/code/session_01PjA1UeTdCC4ou5JjMzUkjm
Change brightness range to 0-400, add current light level cursor indicator below the slider, and use non-linear duration steps (5s increments to 60s, 15s to 3min, 1min to 10min). https://claude.ai/code/session_01PjA1UeTdCC4ou5JjMzUkjm
Replace static description with a dynamic status line showing a green/gray bullet and contextual text that reflects the current state (off, active, time-constrained, etc.). https://claude.ai/code/session_01PjA1UeTdCC4ou5JjMzUkjm
Update toggle/label text casing, adjust paddings, add auto-sizing window controller, gray out disabled controls, and polish the overall settings layout. https://claude.ai/code/session_01PjA1UeTdCC4ou5JjMzUkjm
Author
|
Anyone interested in testing this build can fetch it here. |
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.
Summary
This PR adds time-based scheduling capabilities to DarkModeBuddy, allowing users to restrict automatic dark mode switching to specific time windows. Users can choose between fixed time windows (e.g., 6 PM to 7 AM) or solar-relative scheduling (sunset to sunrise with customizable offsets). This also contains miscellaneous UI improvements.
Key Changes
New Modules
Time Schedule Modes: Added three scheduling modes via
TimeScheduleModeenum:Solar Calculations: Implemented
SolarCalculatorusing NOAA solar equations to compute sunrise/sunset times based on latitude/longitudeLocation Management: Added
LocationManagerto handle location permissions and coordinate retrieval for solar calculationsTime Schedule Manager: New
TimeScheduleManagerclass that:isWithinSchedulestate for UI bindingUI Improvements
Settings & Storage
DMBSettingswith new properties:timeScheduleMode,fixedStartHour/Minute,fixedEndHour/MinutesunsetOffsetMinutes,sunriseOffsetMinutesSolarOffsetenum with predefined offset options (-4h to +4h)System Integration
DMBSystemAppearanceSwitcherto:TimeScheduleManagerMisc Technical Details