Skip to main content

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. Darkdetect 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

It's 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 or newer versions. This package is designed to work also with older versions of macOS and in those cases it will also return None. Detection of the dark menu bar and dock option (available from 10.10) is not supported.
  • Details on the detection method used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

darkdetect-0.1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

darkdetect-0.1.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file darkdetect-0.1.1.tar.gz.

File metadata

  • Download URL: darkdetect-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 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

Hashes for darkdetect-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a868f23ae6647fcb2ecea9b5045b61964cc87ab0639e12b59e15d14b5136259f
MD5 b11d069637cf353257815af9be4128fd
BLAKE2b-256 18a2d223700cf71cfad03366504a310441dd1663d76cc12ac62e0a97e759b398

See more details on using hashes here.

File details

Details for the file darkdetect-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: darkdetect-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.5 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

Hashes for darkdetect-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea7b0fbe2679d6ca4151ea601930743707a699a73c7c519a595c3bd2be90578b
MD5 9914b7eb2d95ee7f8bea4d6bbccd330e
BLAKE2b-256 f5a7e723dcfdc9081c0b196666c3877f67e6c5317d19ad8495474689aa13c405

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page