Repository navigation
We're thrilled to announce the release of version 3.0.0! 🚀
After listening to your feedback, this update brings exciting changes to the API.
Consumers can now react to system theme changes instead of only polling detect(). Two new entry points are available:
dark_light::subscribe() -> Result<Watcher, Error>— a blocking watcher for any thread or event-loop poll, no async runtime required.dark_light::stream() -> Result<impl Stream<Item = Mode>, Error>— an async adapter over the same watcher. Enabled by default via theasync-iofeature, ortokio.
This works across all supported platforms: the XDG portal's SettingChanged D-Bus signal on Linux/BSD, RegNotifyChangeKeyValue on Windows, and the native MediaQueryList change event on WASM.
On macOS, changes are currently detected via a 1-second polling thread rather than a native notification. Observing NSDistributedNotificationCenter requires a hand-rolled Objective-C delegate that isn't yet safely exposed by the objc2 bindings we use, so we're shipping this version now and may revisit it later.
We had originally removed this feature entirely over the macOS limitation, but Linux, Windows, and WASM all had working implementations, and macOS was the only blocker. Dropping the feature for everyone over one platform's rough edges didn't sit right, so we're reintroducing it here.
What's Changed
- chore: prepare for
objc2-foundationv0.3 by @madsmtm in #64 - Bumped ashpd to 0.11.0 by @casperstorm in #65
- feat: remove ashpd use zbus directly by @Decodetalkers in #66
- Upgrade objc2 to 0.6.3 and Remove Unsafe Block #70 by @tom-haines in #71
- Bumped winreg to 0.55.0 by @photino in #72
- feat: support reacting to theme changes via subscribe() and stream() by @edfloreshz in #75
New Contributors
- @casperstorm made their first contribution in #65
- @Decodetalkers made their first contribution in #66
- @tom-haines made their first contribution in #71
- @photino made their first contribution in #72
Full Changelog: 2.0.0...3.0.0