albertosottile / darkdetect

Detect OS Dark Mode from Python
Other
171 stars 18 forks source link

Added dark mode switch listener on Windows and Linux #20

Closed TransparentLC closed 2 years ago

TransparentLC commented 2 years ago

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 commented 2 years ago

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.

TransparentLC commented 2 years ago

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

albertosottile commented 2 years ago

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