Detect OS Dark Mode from Python
A new release of darkdetect is ready. The most prominent new feature is a listener for macOS, finally, thanks to the efforts of @zwimer. In addition, from this release the support for Python 2.7 and any versions older than 3.6 is dropped. Users of older Python versions can continue using darkdetect<=0.7.*
.
Changelog:
listener
function (issue #25, PR #30 by @zwimer)
pip install darkdetect[macos-listener]
setup.py
to pyproject.toml
(PR #28 by @zwimer)It's time for a patch release. The main change is that compatibility with Python 2.7 should now be restored.
Changelog:
__main__
module to make the package callable from a terminal as python -m darkdetect
.This release contains an important change for Linux: from now on, all the themes that have -dark
(case-insensitive) in their names will be detected as 'Dark'
by darkdetect
. Thanks to @DoctorDalek1963 for this contribution!
Changelog:
'-dark'
in theme.lower()
(initially suggested in #17 by @HetDaftary, PR #24 by @DoctorDalek1963. Thanks to @larsoner for his support).distutils.version
to check OS version compatibility. The needed logic was reimplemented (issue #18 by @Carreau).Time for a new release with an exciting new feature: listeners for theme changes for Windows and Linux! Many thanks to @TransparentLC for having implemented those.
Changelog:
callback
API to dynamically detect when the theme is changed on Windows and Linux (issue #14, PR #20 by @TransparentLC)ValueError
when the package is imported on Windows Server (PR #21 by @PierreRaybaut)sys
to platform
to detect the OS versionA few minor bug fixes:
FileNotFoundError
in some headless systems.
None
as if the dark mode were not availablesubprocess
instead of ctypes
(PR #10 by @larsoner, raised in #9 by @HetDaftary)