How To Change Plasma Icon Theme in the Terminal
/u/Da_Viper on Reddit recently asked how to change the plasma icon theme from bash. He’d figured out that [Icons] Theme=breeze
in ~/.config/kdeglobals
changes when you select an icon theme. However modifying that file doesn’t update running applications until you restart.
If we dive into the code for the System Settings KCM on the GitHub mirror, we can see that a new file, changeicons.cpp
, was recently added 6 months ago. Looking at the CMakeLists.txt
, that file is used for a new terminal command called plasma-changeicons
. It’s not in $PATH
however, so we’ll need to call the full filepath.
Run locate plasma-changeicons
to find the filepath. For me in Manjaro with Plasma 5.18, it’s /usr/lib/plasma-changeicons
.
Now that we know the filepath, we can use the folder names found at /usr/share/icons/
and ~/.local/share/icons/
as arguments for the command.
Breaking down the code, CMakeLists.txt
compiles changeicons.cpp
, which in turn will call a function in iconssettings.cpp
.
- https://github.com/KDE/plasma-desktop/blob/master/kcms/icons/CMakeLists.txt#L27
- https://github.com/KDE/plasma-desktop/blob/master/kcms/icons/changeicons.cpp
- https://github.com/KDE/plasma-desktop/blob/master/kcms/icons/iconssettings.cpp#L45
- https://github.com/KDE/kiconthemes/blob/master/src/kiconloader.cpp#L427
It seems iconssettings.cpp
will:
- Delete
~/.cache/icon-cache.kcache
- Notify the change to all KIconLoaders using DBus.
- Run
kbuildsycoca5
System Settings > Icons: GitHub | All Bugs | New Bug | Phabricator | Pull Requests | New PR (Repo: Plasma Desktop)