You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what (little) I've found online there doesn't seem to be a consistent way to detect this on Linux, but it seems like calling:
gsettings get org.gnome.desktop.interface gtk-theme
and looking for -dark at the end would at least get it to work for some of the people some of the time (Debian flavors with dark-configured GTK -- works for me on Ubuntu 20.10 at least!).
Happy to open a PR to subprocess this call if this sort of incremental progress seems sufficiently useful...
Seems to me the ecosystem is a little too vast to get this consistently right across all the Linux platforms. Also, I am not thrilled by a subprocess-based detection method, as that can fail in frozen applications.
Nevertheless, I am not against a PR on this topic, including one that uses subprocess, as users might still benefit from incremental implementations of this feature. So, please feel free to submit one and I will happily review it.
Seems to me the ecosystem is a little too vast to get this consistently right across all the Linux platforms. Also, I am not thrilled by a subprocess-based detection method, as that can fail in frozen applications.
Indeed I imagine it could fail in all sorts of ways. Hopefully a try/except might be good enough for a first version. I'll open a quick PR and we can see if it looks reasonable.
As I mentioned before, for the moment I would prefer to go with the way addressed in #8 as I think is leaner, though more brittle.
Medium term, it could be worthy to investigate how PyGObject is implemented and get the relevant parts needed for just this feature to include just them in Darkdetect.
Activity
larsoner commentedon Mar 18, 2021
From what (little) I've found online there doesn't seem to be a consistent way to detect this on Linux, but it seems like calling:
and looking for
-darkat the end would at least get it to work for some of the people some of the time (Debian flavors with dark-configured GTK -- works for me on Ubuntu 20.10 at least!).Happy to open a PR to
subprocessthis call if this sort of incremental progress seems sufficiently useful...albertosottile commentedon Mar 18, 2021
Seems to me the ecosystem is a little too vast to get this consistently right across all the Linux platforms. Also, I am not thrilled by a
subprocess-based detection method, as that can fail in frozen applications.Nevertheless, I am not against a PR on this topic, including one that uses
subprocess, as users might still benefit from incremental implementations of this feature. So, please feel free to submit one and I will happily review it.larsoner commentedon Mar 18, 2021
Indeed I imagine it could fail in all sorts of ways. Hopefully a try/except might be good enough for a first version. I'll open a quick PR and we can see if it looks reasonable.
cbrnr commentedon Mar 18, 2021
Could you use PyGObject instead?
albertosottile commentedon Mar 18, 2021
I would rather not, as this would violate the "philosophy" of this package of avoiding extra dependencies
cbrnr commentedon Mar 18, 2021
You could nest the import though, so only people who really need it can install the package.
albertosottile commentedon Mar 18, 2021
As I mentioned before, for the moment I would prefer to go with the way addressed in #8 as I think is leaner, though more brittle.
Medium term, it could be worthy to investigate how PyGObject is implemented and get the relevant parts needed for just this feature to include just them in Darkdetect.