We’re thrilled to announce the release of version 2.0.0! 🚀
After much hard work, testing, and listening to your feedback, this update brings exciting changes to the API, performance improvements, and a much needed addition, error management! We hope that this release fixes the issues that prevented many libraries from using this crate.
Important
Earlier this year, I proposed a feature for this library that would notify users when the theme changes. After several iterations, we developed a polished implementation specifically for FreeDesktop systems. Unfortunately, providing this functionality on other platforms proved challenging due platform specific limitations. After careful consideration, we decided not to pursue support for this feature. Instead, we are encouraging window creation libraries to take on this responsibility, ensuring a more seamless experience.
Breaking changes
This version brings breaking changes, the most important one being that dark_light::detect()
now returns Result<Mode, Error>
:
pub fn detect() -> Result<Mode, Error>;
dark-light
is now capable of reporting issues during the attempt to detect the current Mode
.
pub enum Error {
/// If an I/O error occurs.
Io(std::io::Error),
/// If the XDG Desktop Portal could not be communicated with.
XdgDesktopPortal(String),
/// If the timeout is reached.
Timeout,
/// Failed to get persistent domain for Apple Global Domain.
PersistentDomainFailed,
/// If the window could not be found.
WindowNotFound,
/// If the media query could not be executed.
MediaQueryFailed,
/// If the media query is not supported.
MediaQueryNotSupported,
}
We've also managed to close all issues, with only one remaining feature, maybe in our next release.
What's Changed
- Notifications by @edfloreshz in #26
- Use
objc2-foundation
andobjc2-app-kit
by @madsmtm in #37 - Update to detect-desktop-environment 1.1.0 by @demurgos in #35
- Fix resubscribing on every iteration in notify example by @bbb651 in #43
- Freedesktop: use ashpd for both sync & async implementations by @Be-ing in #42
- Improvements to error handling by @edfloreshz in #46
- Split sync and async API by @edfloreshz in #50
- Improvements to API and documentation by @edfloreshz in #52
- Use
futures-lite
instead offutures
andpollster
by @bbb651 in #48 - Remove panic and initial mode from stream by @edfloreshz in #54
- update ashpd to v0.10 by @edwloef in #55
- use async-std feature of ashpd by @Be-ing in #56
- remove sync::subscribe by @Be-ing in #58
- impl From for Mode by @Be-ing in #57
- Improve error handling by @edfloreshz in #59
- Remove subscribe by @edfloreshz in #60
- Add MSRV by @edfloreshz in #61
- Remove futures-lite by @edfloreshz in #62
New Contributors
- @madsmtm made their first contribution in #37
- @demurgos made their first contribution in #35
- @bbb651 made their first contribution in #43
- @edwloef made their first contribution in #55
Full Changelog: 1.1.1...2.0.0