
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
This package allows to detect if the user is using Dark Mode on:
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.
import darkdetect
>>> darkdetect.theme()
'Dark'
>>> darkdetect.isDark()
True
>>> darkdetect.isLight()
False
It's that easy.
You can create a dark mode switch listener daemon thread with darkdetect.listener
and pass a callback function. The function will be called with string "Dark" or "Light" when the OS switches the dark mode setting.
import threading
import darkdetect
# def listener(callback: typing.Callable[[str], None]) -> None: ...
t = threading.Thread(target=darkdetect.listener, args=(print,))
t.daemon = True
t.start()
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.
To enable the macOS listener, additional components are required, these can be installed via:
pip install darkdetect[macos-listener]
None
unless executed on a OS that supports Dark Mode, including older versions of macOS and Windows.FAQs
Detect OS Dark Mode from Python
We found that darkdetect demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.