KDE ships with the Breeze window decorations. Which are drawn via a C++ KDecoration2 “plugin”. You can also download other decorations from the KDE Store (via Get Hot New Stuff) that are SVG based themes for the Aurorae KDecoration2 “plugin” (which is also preinstalled in KDE).
Editing the other SVG based themes is pretty easy, however to edit the Breeze theme you’ll need to recompile some C++ which isn’t as newbie friendly.
First off, lets download the source. The window decorations are a subfolder of the breeze repo, which means we have to download the breeze cursors and the wallpapers too. Luckily the icons are in another repo, but the repo is still several megabytes in size since each wallpaper updates every version and is in 10 different sizes including 4K.
So lets just clone the last commit.
When you try to build, you’ll probably be missing dependencies,
Now lets attempt to build it. Note that we’ll get an error, just keep reading.
Note that we tried to compile the kdecoration folder by itself, rather than compiling the breeze project as a whole. Lets edit the kdecoration/CMakeList.txt so that it doesn’t need the CMakeList.txt in the parent directory.
Lets look at everything before it imports the kdecoration folder and calls it’s CMakeLists.txt.
We can ignore the USE_KDE4 and WITH_DECORATIONS conditionals since they are always going to be false and true in our case. We can also ignore the GtkUpdateIconCache include.
After editing the kdecoration/CMakeList.txt, you’ll need to clean the build directory (just delete the folder rm -r build). Then you can try building again.
If everything compiled 100%, we can focus on patching Breeze with new features. There are 3 things I ended up doing myself.
Remove the blue (highlight color) line under the titlebar when a window is focused.
Remove the triangle in the bottom right when set to No Borders.
Attempt to draw the shadows as if the light source is coming from the top/north instead of the top-left.
Here’s the diffs for each.
1. Remove the blue (highlight color) line under the titlebar when a window is focused.
For this, we just need to comment out where it draws the line. This line is always drawn if the window’s titlebar color and the window’s background is different which you can see here.
Testing the changes
Clean and build the project.
If everything went without a hitch, we can now install it into your system.
Then we can restart KWin to test our changes.
2. Remove the triangle in the bottom right when set to No Borders.
Note: I didn’t realize there was a config option to disable this at the time.
For some reason, when you chose “no borders” it adds this stupid little triangle, which is drawn on top of the window. For now I’ve been using “No side borders” which draws a bottom border but I’d like to fix that.
It’s also straightforward to remove by commenting out some code.
3. Attempt to draw the shadows as if the light source is coming from the top/north instead of the top-left.
This was a request from someone in IRC one time since it’s how OS X does shadows. So I’d already spotted where things were handled. Unfortunately, it was a bit more complicated than I thought, resulting in a bit of trial and error. I’m still not 100% sure I did it correctly, but it works.
Lastly, I would like to point you to the SierraBreeze project, which has forked the C++ Breeze decorations we fussed with above to look like Mac OS. Unlike a .svg Aurorae based theme, it has several options and can follow the KDE/app specific color scheme like Breeze can.