Comments (3)
In principle, I am not against this feature. My only concern is that it has to be clearly documented, so I would consider the PR only if its provides adequate documentation. At the moment, because the API was super simple, our only documentation was the README. With this feature, we might want to add something like readthedocs
, I am not sure.
One thing that should be retained is that Listener
should only work when the OS supports darkdetect
. In other words, the gates provided by __init__
should work also with these classes (e.g. returning BaseListener
or something equivalent added in _dummy
).
Regarding the code example, I think in _linux_detect.Listener
, the class should inherit from BaseListener
?
One small note about how we got here: originally, there were no listeners, then the Windows version was developed and I consider that as "the best" listener: based on ctypes
, no continuous polling, no subprocess, perfectly interruptible. Then the Linux listener was proposed. I am not a Linux user so I could not advise on a better implementation for Linux, and so I had to "blindly" accept the listener implementation for Linux, but I was aware of its limitations. For macOS, I tried quite hard to achieve a similar implementation to the Windows one, but in the end I did not manage, and now we merged #30 and basically propagated the problems of Linux to macOS (with also the addition of the extra dependencies).
To recap, I did not extend/improve the listener
API because I hoped implementing listeners similar to the Windows one would have been possible, some day. But now with #30 I basically accepted that is not possible, and so I believe an API extension along the lines you are proposing makes sense.
from darkdetect.
PR: #32
from darkdetect.
Since we are aligned on requirements, I would close this and keep the discussion in the PR.
from darkdetect.
Related Issues (20)
- Crash on macOS Big Sur 11.4 HOT 19
- SIGSEGV (Address boundary error) on Apple Silicon M1, Big Sur 11.5.2 HOT 6
- Check compatibility with Windows 11 HOT 7
- Listener for dark mode switch? HOT 11
- distutils.version LooseVersion is deprecated HOT 2
- Doesn't work for Pop!_OS 22.04 LTS x86_64 HOT 5
- Module produces ValueError on Windows 8.1 HOT 2
- Implement `listener` for macOS HOT 6
- correct dark detection for gtk3 HOT 19
- A way to terminate listener thread HOT 5
- [RFC] macOS code choices
- macOS listener support on apps where `sys.executable` is not a python interpreter HOT 8
- False positive HOT 1
- Issue: darkdetect listener cannot work under sudo HOT 2
- WARNING message from PyInstaller about ignoring AppKit.framework/AppKit imported from _mac_detect.py HOT 1
- Two Windows 'Dark' modes: `AppsUseLightTheme` and `SystemUsesLightTheme`
- ModuleNotFoundError: No module named 'darkdetect' in Python 3.8 HOT 2
- Duplicate
- Linux (GNOME) HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from darkdetect.