christopher's notes

catppuccin-auto-switch.el

Yesterday I spent some time figuring out how to automatically switch between light and dark flavors of the catppuccin theme in Emacs, using the Linux freedesktop D-Bus API.

Check out my code: https://gist.github.com/cg505/8fbb74d14eedbe9f3e8c8d613bbcd995
Thanks to Peter Hoeg's Emacs StackExchange answer for the basic idea.

Just before posting this, I did a quick search and found that there is a better way to do this, that will also work on Windows and macOS. It uses the auto-dark Emacs package. Probably you should use this for better support, but my code is quite short and simple if you only care about Linux.


If you post a reply on another blog or social media, or just want to chat, email me! christopher@cg505.com