albertosottile / darkdetect

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

Solved the problem with themes like Sweet-Dark-v40 #17

Closed HetDaftary closed 2 years ago

HetDaftary commented 2 years ago

The original code needs the theme name to end with '-dark' and all dark theme names do not end with '-dark'. For example, Matcha-dark-sea or Sweet-Dark-v40 create a problem with the original code has the code detects them as light theme and not dark theme. I have fixed this by finding 'dark' in the theme after converting the theme name to lower case.

albertosottile commented 2 years ago

Hi, thanks for this contribution.

I am fine with this, but I also hope this would not cause wrong detections in the other direction. Having to rely solely on having "dark" in the theme name seems a little feeble, if you ask me. At least the suffix -dark was a little more specific.

Is there a place where all these theme names are listed?

DoctorDalek1963 commented 2 years ago

I've updated this PR in #24, where I add the same fix to the listener() function. I would suggest rejecting this one and merging that one instead.

albertosottile commented 2 years ago

I am closing this since it was superseded by #24. @HetDaftary I hope the merged outcome is acceptable for you and I apologize that your PR was, in the end, discarded.