Detect macOS Mojave Dark Mode from Python
Project description
Darkdetect
This package allows to detect if macOS 10.14+ is running with the Dark mode enabled. The main application of this package is to detect the Dark mode from your GUI Python application (Tkinter/wx/pyqt/qt for python (pyside)/...) and apply the needed adjustments to your interface. This package is particularly useful if your GUI library does not provide a public API for this detection (I am looking at you, Qt). In addition, this package does not depend on other modules or packages that are not already included in standard Python distributions.
Usage
import darkdetect
>>> darkdetect.theme()
'Dark'
>>> darkdetect.isDark()
True
>>> darkdetect.isLight()
False
Is that easy.
Install
The preferred channel is PyPI:
pip install darkdetect
Alternatively, you are free to vendor directly a copy of Darkdetect in your app. Further information on vendoring can be found here.
Notes
- This software is licensed under the terms of the 3-clause BSD License.
- This package can be installed on any operative system, but it will always return
None
unless executed on macOS 10.14 Mojave. This package is designed to work also with older versions of macOS and in those cases it will also returnNone
. Detection of the dark menu bar and dock (available from 10.10) is not supported. - Details on the detection method used.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file darkdetect-0.1.0.tar.gz
.
File metadata
- Download URL: darkdetect-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df5712bd7193e13df8b282fa9cf07f865d0001d06a6cb11b137abefbedf47851 |
|
MD5 | bd3ac70b2b49ddcb4988dd8f14ed0c14 |
|
BLAKE2b-256 | 366236ca9e3d61605bf6e2497591aa0e26a29c30457d311a84473a08e2387397 |
File details
Details for the file darkdetect-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: darkdetect-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d3dc27bedc1cfaae9bc9bb9345cf85d526a2fb62bccc4c11161b9b38c914b29 |
|
MD5 | ba29fc6c145563124526911f38ead0c6 |
|
BLAKE2b-256 | bd20898af0c8dee832ba9b8066139de6d90e777952aff5401ab9d57d09b49884 |