LionyxML / auto-dark-emacs

Auto-Dark-Emacs is an auto changer between 2 themes, dark/light, following MacOS, Linux or Windows Dark Mode settings
GNU General Public License v2.0
140 stars 34 forks source link

Use D-Bus for Linux theme awareness #20

Closed J3RN closed 1 year ago

J3RN commented 1 year ago

The thrust of this change is to use D-Bus' notion of "color-scheme" instead of Dconf's notion of GTK theme, as detailed in #19.

Feature changes:

Other changes:

I have some more ideas for cleaning up the macOS stuff, but I'll save those for another PR :grin:

LionyxML commented 1 year ago

@seagle0128 , since you were the first to implement something for Linux, I would appreciate some feedback on this take by @J3RN.

There was some discussion on Reddit and here on #19 about d-bus being a better way to check the theme state then relying on the current method that some said only worked with a specific theme.

@J3RN also, if you could provide us with some demo gif of auto-dark working under Linux with d-bus, it would be great for docs, something like what we have here: https://github.com/LionyxML/auto-dark-emacs/tree/master/images (could be another PR at another time though, your call).

seagle0128 commented 1 year ago

Basically dbus is a more common approach, but I didn't test with many Linux distributions. I agree with the changes, but please format the codes before check-in.

J3RN commented 1 year ago

I rewrote the doc strings such that checkdoc no longer complains and I converted all indentation to spaces except where it was tabs before (i.e. the Applescript) as the tabs seemed rather arbitrarily placed.

This byte-compiles cleanly on my machine except for a gripe about ns-do-applescript, which is present in Emacs for Mac OS X and Emacs Plus but not in my Linux build. IMO probably nothing to worry about.

LionyxML commented 1 year ago

Thanks you all!

It looks like we did it. A 31th Dec merge :)

edgar-vincent commented 1 year ago

Thank you very much for this PR, @J3RN, it's lovely!