Scratching an itch: Switching my KDE-Plasma themes globally
In a recent post I wrote about how I, somewhat spontaneously, changed my desktop environment and am overall using the Solarized theme now everywhere I can. Looking at the themes that are around nowadays, Solarized might be old-school, but it is the best theme for my eyes, I like it and in fact have been using it for quite some time already.
Changing the desktop theme in my, new for me, KDE-Plasma-desktop[1] is trivial and one of the reasons I enjoy using it. While there doesn't seem to be dedicated theme-toggle out of the box in KDE (I might be wrong but at the least couldn't find one so far) doing so via the command-line is simple.
For the latter, the command plasma-apply-colorscheme BreezeSolarizedLight
(or whatever other choice of theme you have) is your friend here and also attaching a keyboard shortcut to said command is quick and easy thing to do via the settings System Settings -> Keyboard -> Shortcuts -> Add New (command or script)
and that's it.
While this changes most of the themes of the apps that I have running, Emacs doesn't automatically change the themes.
So, I scratched a little itch here and set up a theme switch for both the Emacs theme and the KDE-Plasma desktop at the same time, and thus all/most other apps that I have running.
The code I came up with is rather straight forward:
(defun svbck/global-solarized-light ()
(interactive)
(shell-command "plasma-apply-colorscheme BreezeSolarizedLight")
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'doom-solarized-light :no-confirm))
(defun svbck/global-solarized-dark ()
(interactive)
(shell-command "plasma-apply-colorscheme BreezeSolarizedDark")
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'doom-solarized-dark :no-confirm))
So, when I am in Emacs I can also simply invoke these commands (I have set them up in my "menu-transient") as well and turn the lights on or off.
- I am using KDE only for a short time at the moment, but I am enjoying KDE-Plasma a lot. It's easy to configure and I can set it up very nicely to suit my needs. ↩︎