Nova Flow OS
KDE Developer Platform
KDE Developer Platform
  • KDE Developer Platform
    • Getting started
      • Building KDE software
        • KDE software
        • Where to find the development team
        • Learning more
        • Choose what to work on
        • Source code cross-referencing
        • Installing build dependencies
        • Set up a development environment
        • Building KDE software with kdesrc-build
        • Basic troubleshooting
        • Tips and tricks
        • IDE Configuration
          • Setting up an IDE for KDE development
          • Visual Studio Code
          • Qt Creator
          • Kate
          • KDevelop
          • CLion
          • Sublime Text
        • Building KDE software manually
        • Building KDE software with distrobox and podman
      • Kirigami
        • KDE is ours
        • Setting up and getting started
        • Explaining pages
        • Layouts, ListViews, and Cards
        • Adding actions
        • Adding a dialog
        • Using separate files
        • Next steps
        • Colors and themes in Kirigami
        • Typography
        • Actions based components
        • Page rows and page stacks
        • Scrollable pages and list views
        • Cards
        • Drawers
        • Chips
        • Dialog types
        • Controls and interactive elements
        • Form layouts
        • Inline messages
        • Action toolbars
        • Progress bars and indicators
        • List views
        • Understanding CMakeLists
        • Figuring out main.cpp
        • Connect logic to your QML user interface
        • Connect models to your QML user interface
        • About page
        • Introduction to Kirigami Addons
        • FormCard About pages
        • Form delegates in your settings pages
      • KXmlGui
        • Getting started with KXmlGui
        • Hello World!
        • Creating the main window
        • Using actions
        • Saving and loading
        • Command line interface
      • Python with Kirigami
        • Apps with QML and Python
        • Your first Python + Kirigami application
        • Creating a Python package
        • Creating a Flatpak
      • Common programming mistakes
      • Adding a new KDE project
    • Features
      • Icons
      • Configuration
        • The KConfig Framework
        • Introduction to KConfig
        • Using KConfig XT
        • KDE Frameworks 6 porting guide
        • Settings module (KCM) development
        • KConfigDialog
      • D-Bus
        • What is D-Bus practically useful for?
        • Introduction to D-Bus
        • Accessing D-Bus interfaces
        • Intermediate D-Bus
        • Creating D-Bus interfaces
        • Using custom types with D-Bus
        • D-Bus autostart services
      • Create your own mouse cursor theme
      • Session management
      • Archives
      • Desktop file
      • KAuth
        • Privilege Escalation
        • Using actions in your applications
      • KIdleTime
      • Akonadi: personal information management
        • Debugging Akonadi Resources
        • Using Akonadi in applications
      • Concurrent programming
      • Solid
      • Sonnet
    • Plasma themes and plugins
      • Getting started
      • Plasma Widget tutorial
        • How to create a plasmoid
        • Setup
        • Porting Plasmoids to KF6
        • Testing
        • QML
        • Plasma's QML API
        • Widget Properties
        • Configuration
        • Translations / i18n
        • Examples
        • C++ API
      • KWin Effects
      • Plasma Desktop scripting
        • Javascript Interaction With Plasma Shells
        • Templates
        • Examples
        • API documentation
        • Configuration keys
      • Plasma Style tutorial
        • Creating a Plasma Style quickstart
        • Understanding Plasma Styles
        • SVG elements and Inkscape
        • Background SVG format
        • System and accent colors
        • Theme elements reference
        • Porting themes to Plasma 5
        • Porting themes to Plasma 6
      • Aurorae window decorations
      • KWin scripting tutorial
        • Quick start
        • KWin scripting API
      • Wallpapers
      • Plasma comic
        • Tutorial
        • Testing and debugging
        • Examples
      • Create a custom Window Switcher
      • KRunner C++ Plugin
        • Basic Anatomy of a Runner
        • KRunner metadata format
    • Applications
      • Creating sensor faces
      • Dolphin
        • Creating Dolphin service menus
      • Kate
        • Kate plugin tutorial
      • KMines
        • Making a KMines theme
      • Writing tests
        • Appium automation testing
    • Packaging
      • Android
        • KDE on Android
        • Building applications for Android
        • Packaging and publishing applications for Android
        • Publishing on Google Play
          • Introduction
          • Packaging your app
          • Adding your app to Google Play
          • Publishing your app
          • Releasing new versions of old apps
        • Porting applications to Android
          • Basic porting
          • Making applications run well on Android
          • Metadata
      • Windows
        • Packaging and publishing applications for Windows
        • Publish your app in the Microsoft Store
          • Packaging your app for the Microsoft Store
          • Submitting your app to the Microsoft Store
      • Plasma Mobile
        • KDE on mobile devices
        • Porting a new device to Plasma Mobile
        • KDE Telephony stack
          • General Overview
          • Kernel layer
          • System daemons
            • General overview
            • Developing Telephony functionality
            • ModemManager Telephony functions
          • Session daemons
          • QML declarative plugin layer
          • KDE application layer
        • Execute applications
      • Distributing KDE software as Flatpak
        • Your first Flatpak
        • Extending your package
        • Nightly Flatpaks and Flathub
        • Testing your Flatpak
    • System administration
      • Shell scripting with KDE dialogs
      • Kiosk: Simple configuration management for large deployment
        • Abstract
        • Introduction to Kiosk
        • Kiosk keys
    • Contribute to the documentation
    • About
      • Readme
      • License
        • Creative Commons Attribution-ShareAlike 4.0 International
        • GNU General Public License 3.0 or later
Powered by GitBook
On this page
  • Package structure
  • Window frame
  • Buttons
  • Configuration
  • Layout
  • Metadata
  • Publishing
  1. KDE Developer Platform
  2. Plasma themes and plugins

Aurorae window decorations

How to create window decorations with SVGs

PreviousPorting themes to Plasma 6NextKWin scripting tutorial

Last updated 8 months ago

Aurorae is a theme engine for KWin window decorations, i.e. the frames around windows that typically contain the window title and buttons for closing, minimizing, etc. the window. Aurorae uses either SVG or QML to render the decoration and buttons, and there is a simple config file for configuring the theme details. Alternatively, it is possible to write window decorations in C++ using the . This article describes how to create a theme with SVGs.

A simple way to start creating your own theme is by modifying an existing one. You can find many existing themes in the . One example is .

Package structure

An Aurorae theme consists of one folder containing

  • SVG files for decoration and buttons

  • one KConfig rc file for the theme details

  • one metadata.desktop file for information about the theme.

🗀 ExampleDecoration
├── 🗎 metadata.desktop
├── 🗎 ExampleDecorationrc
├── 🗎 decoration.SVG
├── 🗎 close.SVG
├── 🗎 maximize.SVG
├── 🗎 minimize.SVG
├── ...

Each SVG file needs to include certain custom for it to be managed correctly as part of a window decoration. With a vector graphics editor like , these attributes can be edited by selecting an object, opening the Object Properties pane and changing the ID and Label fields. It is also possible to make use of colors from the .

System-wide installed Aurorae themes are located in /usr/share/aurorae/themes/ and user-specific themes are located in ~/.local/share/aurorae/themes/. If you copy your folder into the user folder, it will be available for selection in System Settings. Just make sure you have the matching theme name for the folder, the configuration file and the metadata file, as described in the sections below.

Window frame

Each decoration state element is composed of one element for each window side which have the name of the side as a suffix in the ID: left, right, top, bottom, topleft, topright, bottomleft, bottomright, center.

Basic decoration

The base decoration element has to use the prefix decoration, like in the case of decoration-inactive or decoration-top.

Inactive windows

A different style for inactive windows can be provided in the same SVG. The inactive elements must have the element prefix decoration-inactive. If not provided, inactive windows will be rendered with the same style as active windows.

Opacity

A special decoration for opaque mode, that is when compositing is not active, can be provided. The element prefix is decoration-opaque for active and decoration-opaque-inactive for inactive windows. If not provided, the engine falls back to the translucent version.

Blur

Inner borders

Aurorae supports inner borders, that is a border at the margin to the window. While it would be possible to add inner borders directly in the decoration element, the inner borders are to be preferred as those support the configurable border sizes.

For inner borders, the decoration SVG file can include two additional FrameSvgs: innerborder and innerborder-inactive. If the inactive element is not present the active element is used for inactive windows.

These frames must include the border elements. Only the border elements will be visible, the center element is not visible. For performance reasons, the center element should be a simple rectangle and for support of decoration behind windows it should be completely translucent.

Inner borders are not shown for maximized windows. If a maximized window should show an inner border it is recommended to directly add it to the maximized element.

Maximized windows

In order to better support maximized windows there exists a special frame SVG called decoration-maximized. In the same way as for the general decoration a version for inactive, opaque, and inactive-opaque can be specified: decoration-maximized, decoration-maximized-inactive, decoration-maximized-opaque and decoration-maximized-opaque-inactive. If not provided, the engine falls back to the normal decoration.

In all cases, only the center element will be used. There is no need to specify borders. Please note that in the case of a window with translucent widgets, the center element will be stretched to the size of the complete window. In order to support Fitts' Law all TitleEdge Settings are set to 0. So the buttons will be directly next to the screen edges.

Buttons

Each button has to provide the center element.

Borders are not supported.

Button types

The following buttons are supported:

  • close (X): closes the window

  • minimize (I): minimizes the window

  • maximize (A): maximizes the window; replaces the ''restore'' button when not maximized

  • restore: restores the window from maximized state; replaces the maximize button when maximized

  • alldesktops (S): show window on all desktops (also known as "sticky")

  • keepabove (F): keep window above other windows

  • keepbelow (B): keep window below other windows

  • shade (L): shade the window

  • help (H): show help information

  • (M): window menu ("Move to Desktop", "Move to Screen", etc.). This button is not to be provided as an SVG file, but is available for use in the configuration.

  • (N): application menu ("File", "Edit", "View" etc.). This button is not to be provided as an SVG file, but is available for use in the configuration.

Each button SVG file needs to be named after the button type; e.g. the close button has to be named close.svg. The letter in brackets is the button name to be used in the configuration (see below).

Button states

Each button can have different states. It could be hovered, pressed, or deactivated and the theme might want to provide different styles for active and inactive windows. The following element prefixes can be used to provide styles for the buttons:

  • active: normal button for active windows

  • inactive: normal button for inactive window s

  • hover: hover state for active windows

  • hover-inactive: hover state for inactive windows

  • pressed: button is pressed

  • pressed-inactive: button is pressed for inactive windows

  • deactivated: button cannot be clicked, e.g. window cannot be closed

  • deactivated-inactive: button cannot be clicked for inactive windows

At least the active element has to be provided. All other elements are optional and the active element is always used as a fallback. If the theme provides the inactive element, this is used as a fallback for the inactive states. That is if the theme provides a hover element, but none for inactive, the inactive window will not have a hover effect. The same is true for pressed and deactivated.

The buttons alldesktops, keepabove, keepbelow and shade are toggle buttons. When clicking on them they will stay in pressed(-inactive) state. By clicking them again they will change back to (in)active.

All of those elements have to be put into one SVG file for a button type.

Configuration

In a configuration group with the heading [General] the following options can be set:

  • TitleAlignment: horizontal alignment of the window title (default: Left)

  • TitleVerticalAlignment: vertical alignment of the window title (default: Center)

  • Animation: animation duration in msec when hovering a button and on active/inactive change (default: 0)

  • ActiveTextColor: title text color of active windows (default: 0,0,0,255)

  • InactiveTextColor: title text color of inactive windows (default: 0,0,0,255)

  • UseTextShadow: draw a shadow behind the title text (default: false)

  • ActiveTextShadowColor: shadow text color of active windows (default: 255,255,255,255)

  • InactiveTextShadowColor: shadow text color of active windows (default: 255,255,255,255)

  • TextShadowOffsetX: offset of shadow in x direction (default: 0)

  • TextShadowOffsetY: offset of shadow in y direction (default: 0)

  • HaloActive: draw a halo behind the title of active windows (default: false)

  • HaloInactive: draw a halo behind the title of inactive windows (default: false)

  • LeftButtons: buttons in the left button group (default: MS)

  • RightButtons: buttons in the right button group (default: HIAX)

  • Shadow: decoration provides shadows (default: true)

  • DecorationPositon: decoration on top (0), left (1), right (2), or bottom (3) (default: 0)

If Shadow is enabled, Padding values have to be added to the layout configuration (see below).

Layout

The following diagrams illustrate which configuration value influences which part of the decoration:

Window:

 ___________________________________________________________________
|                 PaddingTop                                        |
|  _______________________________________________________________  |
| |              TitleEdgeTop                                     | |
| |_______________________________________________________________| |
| | TitleEdgeLeft |   [title]                    | TitleEdgeRight | |
| |_______________|______________________________|________________| |
| |              TitleEdgeBottom                                  | |
| |_______________________________________________________________| |
| | |                                                           | | |
|PaddingLeft                                            PaddingRight|
| | |                                                           | | |
| |BorderLeft                                          BorderRight| |
| |_|___________________________________________________________|_| |
| |              BorderBottom                                     | |
| |_______________________________________________________________| |
|                PaddingBottom                                      |
|___________________________________________________________________|

Title:

 __________________________________________________________________________
| ButtonMarginTop             |             |              ButtonMarginTop |
|_____________________________|             |______________________________|
| [Buttons] | TitleBorderLeft | TitleHeight | TitleBorderRight | [Buttons] |
|___________|_________________|_____________|__________________|___________|

Buttons:

 _____________________________________________________________________________________________
| button | spacing | button | spacing | explicit spacer | spacing | ...    | spacing | button |
|________|_________|________|_________|_________________|_________|________|_________|________|

The layout can be configured in a configuration group named [Layout] with the following options and values:

  • BorderLeft (default: 5)

  • BorderRight (default: 5)

  • BorderBottom (default: 5)

  • BorderTop (default: 0)

  • TitleEdgeTop (default: 5)

  • TitleEdgeBottom (default: 5)

  • TitleEdgeLeft (default: 5)

  • TitleEdgeRight (default: 5)

  • TitleEdgeTopMaximized: (default: 0)

  • TitleEdgeBottomMaximized: (default: 0)

  • TitleEdgeLeftMaximized: (default: 0)

  • TitleEdgeRightMaximized: (default: 0)

  • TitleBorderLeft (default: 5)

  • TitleBorderRight (default: 5)

  • TitleHeight (default: 20)

  • ButtonWidth (default: 20)

  • ButtonWidthMinimize (default: 20)

  • ButtonWidthMaximizeRestore (default: 20)

  • ButtonWidthClose (default: 20)

  • ButtonWidthAlldesktops (default: 20)

  • ButtonWidthKeepabove (default: 20)

  • ButtonWidthKeepbelow (default: 20)

  • ButtonWidthShade (default: 20)

  • ButtonWidthHelp (default: 20)

  • ButtonWidthMenu (default: 20)

  • ButtonHeight (default: 20)

  • ButtonSpacing (default: 5)

  • ButtonMarginTop (default: 0)

  • ExplicitButtonSpacer (default: 10)

  • PaddingTop (default: 0)

  • PaddingBottom (default: 0)

  • PaddingRight (default: 0)

  • PaddingLeft (default: 0)

Border<Direction> is only required if the decoration is not in that direction; e.g. BorderTop is only required for decorations on the left, right, or bottom. Padding<Direction> values can be used to provide shadows. The ButtonWidth<Action> values are optional, falling back to ButtonWidth if not specified.

If the decoration handles are on a side other than the top, layout options that only exist in a version for the top change their meaning to that side; e.g. with DecorationPosition=1 (where 1 means left), ButtonMarginTop will mean ButtonMarginLeft, whereas e.g. the TitleEdge options remain unchanged as they are defined for all four sides. A shaded window will always have the decoration on the top, so the layout is transformed to be painted on the top again.

The user can change the border and button sizes in the settings dialog. The defaults are the settings specified in the configuration file. The configurable border size influences the right, left, and bottom borders, and the button size influences both the size of all buttons and the title height.

It is important to remember that the buttons have to be scalable to correctly support this feature and that the borders may extend into the center element if the border size is changed.

Metadata

  • Name: the name of the theme displayed in theme selection

  • Comment: a comment for the theme, e.g. "Aurorae theme inspired by Oxygen decoration"

  • X-KDE-PluginInfo-Name: an ID name for the theme, which should be identical to the folder name

  • X-KDE-PluginInfo-Author: the name of the author used in the about dialog

  • X-KDE-PluginInfo-Email: the author's email address used in the about dialog

  • X-KDE-PluginInfo-Website: the webseite of the theme

  • X-KDE-PluginInfo-Version: version of the theme, e.g. 1.0

  • X-KDE-PluginInfo-License: the license of the theme, e.g. GPLv3

Publishing

The window frame has to be provided in a file decoration.svg (). This SVG has to contain all the elements required for a Plasma theme background. Different styles for special states (such as active or inactive) can optionally be provided in the same SVG file.

If transparent decorations should receive a blur effect, an element named mask must be provided which specifies the region to apply blur to. The mask element should use the same padding as for active and inactive decorations. An example can be found in . If no mask element is provided, blur will be disabled for the theme.

An SVG file has to be provided for each button (). If the theme does not provide a file for a button type the engine will not include that button, so the decoration will miss it. There is no fallback to a default theme. The buttons are rendered using Plasma's FrameSvg just like the decoration.

The configuration file must have as its name the plugin name provided in the metadata file followed by the suffix rc (). The configuration file is a KConfig file following the .

The theme must contain a metadata.desktop file for information about the theme such as name, author, license, etc (). The format follows the , starting with a group heading [DesktopEntry] and supporting the following entries:

Once you have created something nice, consider sharing it with other Plasma users! Create a zip file of the package folder and upload it to the under the category Linux/Unix Desktops > Desktop Themes > KDE > KDE Plasma > Plasma Window Decorations. Users will then be able to find and install your theme with or via “Get New Window Decorations…” in System Settings.

KDecoration2 API
KDE Store
Breeze Active Accent
attributes
Inkscape
system color scheme
example
this demonstration theme
example
example
Desktop Entry Specification
example
Desktop Entry Specification
KDE Store
Discover