Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dark mode switch listener on Windows and Linux #20

Merged
merged 6 commits into from
May 22, 2022
Merged

Added dark mode switch listener on Windows and Linux #20

merged 6 commits into from
May 22, 2022

Conversation

TransparentLC
Copy link
Contributor

@TransparentLC TransparentLC commented May 4, 2022

Implemented with WIN32 API on Windows and gsettings monitor org.gnome.desktop.interface gtk-theme on Linux. See my comment in #14 for details.

@albertosottile
Copy link
Owner

Hi, thank you for your contribution. The implementation is nice and clean. However, the rationale behind darkdetect was to have a lightweight pure-Python package, with no non-standard dependencies, that could be embedded in more complex Python projects (e.g. Syncplay). I feel that introducing platform specific Python wheels would break this philosophy.

At the moment, as I mentioned in #14, this is a task that I see more suitable for the GUI library. Nevertheless, if you could manage to reimplement this code through ctypes, then I would definitely accept it as it would eliminate all the previously mentioned drawbacks, while still providing this valuable feature.

@albertosottile albertosottile added the enhancement New feature or request label May 9, 2022
@TransparentLC
Copy link
Contributor Author

I have reimplemented the listener by ctypes. Feel free to try it out!

@TransparentLC TransparentLC changed the title Added dark mode switch listener on Windows Added dark mode switch listener on Windows and Linux May 20, 2022
Copy link
Owner

@albertosottile albertosottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this contribution. I tested it on Windows and the code LGTM, I only have a few minor comments.

README.md Outdated Show resolved Hide resolved
darkdetect/_dummy.py Outdated Show resolved Hide resolved
darkdetect/_mac_detect.py Outdated Show resolved Hide resolved
@albertosottile albertosottile merged commit c7dff06 into albertosottile:master May 22, 2022
@albertosottile
Copy link
Owner

Thank you again for this. I will try to create a new release later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants