Closed ProjectMoon closed 1 year ago
Based on another comment in the same Reddit thread, it is probably best to utilize dbus to expose a similar hook system like on Mac OS: https://git.sr.ht/%7Edsemy/emacs-config/tree/master/item/init.d/init-interfaces.el#L44
I can confirm that auto-dark-mode does not work on Fedora with customized themes. Most probably for the reasons explained above. I look forward to test new versions of the package with updated functionality.
Based on another comment in the same Reddit thread, it is probably best to utilize dbus to expose a similar hook system like on Mac OS: git.sr.ht/%7Edsemy/emacs-config/tree/master/item/init.d/init-interfaces.el#L44
I can confirm that the dbus code works well (GNOME 43.1 with custom theme), and this seems much better than a polling solution.
Hello there! Sorry I've been out for a while. Personal stuff :(
I agree with you guys that a solution base on d-bus integration might be a better approach for Linux users.
Anyone willing to tweak the code and open a PR? I might do it myself in the future, but currently I don't even have Linux installed here around.
After having used the dbus snippet in my own emacs config for a while, the main thing it needs is to test light/dark mode on Emacs startup. Otherwise, it's only responding to events and you may end up with the wrong theme when starting a new instance of Emacs.
The above snippet for spacemacs handles the setting at startup via run-hook-with-args
. (By the way, I think the only spacemacs-specific thing here is spacemacs/load-theme
.)
Hmm, you are right. Somehow I had the hook defined after the rest of the code, and it didn't run on startup. But after putting the hook definition above, it works.
Hello there good people! :)
@J3RN's PR #20 has been merged and is already available on MELPA.
auto-dark
now uses D-Bus as default theme checker for GNU/Linux.
It does not seem to set the correct theme on startup. Is there need still to configure a hook to make the initial check?
It does not seem to set the correct theme on startup. Is there need still to configure a hook to make the initial check?
Are you on spacemacs by any chance? I'm on spacemacs and I just figured out that I need to replace the load-theme
with spacemacs/load-theme
in auto-dark--set-theme
to make this work on startup...
I'm not sure how to approach this issue properly, to be honest. Maybe there should be a possibility to tell spacemacs to just get out of the way with their theme logic. Setting dotspacemacs-themes
to nil
doesn't achieve this.
I am on Doom Emacs, but I imagine that something similar to what you mention may be happening. I will investigate the issue a bit, and will revise also how circadian solves it, since circadian is working flawlessly -although I must set a fixed time for the change-.
Thanks your help. Wish me luck! 🤓
Auto-dark works if, after opening Emacs, I disable it manually and re-enable it manually. At that point it loads the correct theme. May anyone please share how are you configuring it on your config file? I may be doing something wrong there and thus the problem on opening.
Hello there!
I really think these feedbacks are great! But doing so from this "closed" issue may not get to all people involved.
I just opened the issue #25
May we migrate this to there?
This is a copy and paste of my Reddit comment.
Unless I'm missing something, this only works if you have the
Yaru-dark
theme installed and in use. This isn't a standard GNOME theme (usually it is Adwaita).It would make more sense to provide configurable variables for the light/dark GTK theme names. Or better yet, make use of the
/org/gnome/desktop/interface/color-scheme
dconf setting. This is the new Gnome standard way of doing dark mode. When it's light, it'sdefault
, and when it's dark, it'sprefer-dark
. I think it's available from Gnome 42 onwards.Edit: The
\n
should be removed from the check as well, becausestring-trim
gets rid of it, and thus the equality check fails when\n
is there.