Creating Plasma 6 Custom Window Decoration

Hi all,

I was curious about creating a custom window decoration and wondering what the process will be for Plasma 6? I’ve been looking a bit but couldn’t find much in the way of a guide or documentation, but was trying to figure out how this process will be handled in the next generation Plasma 6.

I’ve read that the window decoration in Plasma 5 and before was compiled code. And there was some attempt to create an interface with the Aurorae project. But I also read that development on that halted. I am trying to get a sense of how this may change in Plasma 6? If it isn’t what’s the best way to get started or where to look at code to start getting a sense of how I can start creating a window decoration theme idea I have. I see that there is the KDecoration2 module which seems to be a start. Will that hold true in Plasma 6?
If so does anyone know a good theme where this was built from code to start familiarizing myself with the process?

Appreciate any help or insight or nudge in the right direction!

1 Like

In 5 you can build decorations using the kdecoration interface as well as Aurorae (which allows to use QML or SVG-based decorations and internally uses kdecoration). In 6 this isn’t going to be (much) different

1 Like

Custom decorations are a huge thing since 5.27

Aurorae are broken afaik. And no decorations I could find expand their clickbox to the very upper corner, only breeze. And thats a shame as I prefer many over those.

Not sure what you mean by “expand the clickbox”. In either case, you might wanna have a look at window decorations with more options. Klassy for example. At least that one supports blur which Breeze doesn’t. At least, not anymore, since they introduced the highlight abomination.

I guess expand the clickbox means to put the mouse pointer to the very top right, and be able to click on close. Something GNOME is not supporting, as well as some decorations, which is nuts on a Desktop

O that. Another topic was about it. You can do it in gnome though, with a bit of css. I don’t use titlebars but I found a workaround for it on x11. Haven’t found a wayland compatible option for it though.

1 Like

That “other topic”…for the life of me, can’t find it anymore. In either case it was about that close function of maximized windows by clicking a corner. Although there’s a workaround with some css padding of the close buttons it’s a bit silly. But me, I have my panel at the top and, since I don’t use titlebars, I mostly close my windows using the active window widget. But I also have the “Spacer as Pager” widget. On X you could use xdotool to invoke the close shortcut, but that doesn’t work on Wayland. I haven’t tried ydotool yet but another way of closing things is to use qdbus. In my case the command would then be "qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut “Window Close”. You can find which command ( shortcut name) to use by typing “qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.shortcutNames” in a terminal. I suggest you use the terminal to define it cause it only uses English locale as far as I know. The widget itself only needs one pixel to be activated. So that’s an easy “workaround” to close windows without even looking really.