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
  • Creating a Plasma Style in 7 Easy Steps
  • Testing the Theme
  • Theme Colors
  • Hints and Tips
  1. KDE Developer Platform
  2. Plasma themes and plugins
  3. Plasma Style tutorial

Creating a Plasma Style quickstart

A quick guide to creating your first Plasma Style

PreviousPlasma Style tutorialNextUnderstanding Plasma Styles

Last updated 8 months ago

One of Plasma's features is the ability to theme desktop elements using Scalable Vector Graphics (SVGs). This means there is no need for theme authors to know C++ or any other programming language to create a great looking theme. They need only use common graphics tools like Krita, Inkscape, GIMP, etc. Depending on your prowess with such tools, a great looking Plasma Style can be created in under an hour.

A is available to learn how to edit Plasma Styles.

Creating a Plasma Style in 7 Easy Steps

Step 1: Using an existing theme

Copy and rename an existing Plasma Style folder. The new folder name should be the name of the theme. Themes provided by your distribution are stored in /usr/share/plasma/desktoptheme/, while user-installed themes go in ~/.local/share/plasma/desktoptheme/. You can also find . Edit the metadata.json file in the theme folder to match your theme name.

See [Theme Metadata]({{< ref "theme-details#theme-metadata">}}) if you need help.

Important

Prior to KDE Frameworks 6, themes used a metadata.desktop file instead of metadata.json.

# Create theme directory in home if it doesn't exist
mkdir -p ~/.local/share/plasma/desktoptheme
# Copy default theme to home directory so we can modify it
cp -r /usr/share/plasma/desktoptheme/default ~/.local/share/plasma/desktoptheme/
# Rename theme
cd ~/.local/share/plasma/desktoptheme
mv ./default ./mytheme
# Edit the relevant fields in the metadata.json
# with your theme information and credits.
# Remove any translation names or descriptions
# (entries like Name[fr] or Description[zh_CN]).

Note The default/ theme is the base Breeze theme with all the default SVGs. breeze-light/ and breeze-dark/ only have a colors file and a pair of metadata files and inherit everything else from the default/ theme.

Step 2: Open a file

Open the SVG file associated with the Plasma element you would like to theme (panel background, clock, etc.) in an SVG editor (e.g. Inkscape).

See [Theme Location, Structure and Definition]({{< ref "theme-details#structure" >}}) to understand how Plasma Styles are organized, and the [Theme Elements Reference]({{< ref "theme-elements.md">}}) to understand what each SVG file does.

Step 3: Edit each element

Each SVG file may have several elements (objects with element ID = left, right, top, topright, center, ClockFace, etc.). Modify existing elements OR delete and create replacement elements. Elements can be any SVG primitive or object group.

See [SVG Elements and Inkscape]({{< ref "theme-svg.md" >}}) to understand how to edit Plasma SVG elements.

Hint

You can embed raster images as SVG elements if you creatively prefer raster editors like Krita, GIMP, etc. Remember to embed each image instead of linking (Inkscape: Effects -> Images -> Embed All Images).

Step 4: Use an Inkscape extension

Step 5: Review element IDs

Make sure that the element ID for each new element is correctly set.

Hint

In Inkscape you can check the element ID for each element by right-clicking on the element and choosing Object Properties.

Step 6: Edit hint elements

Add or remove any element containing a hint ID you desire. It doesn't matter how the element looks, just that elements with IDs matching the hint elements either exist or don't exist. See [Background SVG Format]({{< ref "/docs/plasma/theme/background-svg" >}}) for a description of available hint elements.

Step 7: Save the SVG file.

Repeat steps 3 - 6 for any other Plasma element for which you would like to create a new theme.

Testing the Theme

  • If you have not already done so, copy your new theme folder to ~/.local/share/plasma/desktoptheme.

  • Choose the theme in System Settings -> Appearance -> Plasma Style or edit your ~/.config/plasmarc to point to the new theme. This may require restarting Plasma.

  • Carefully check the appearance of all new theme elements.

  • If you created separate themes that do not require compositing/desktop effects (SVGs in the opaque/ folder), remember to test your theme with compositing turned off (this can be toggled with the keyboard shortcut Alt+Shift+F12 on X11).

Note

The opaque/ folder is only relevant for themes on the Plasma X11 session, as the Wayland session does not allow to turn off compositing. See [Opaque Folder]({{< ref "theme-elements#opaque-folder" >}}) for details.

When you update the theme, you need to battle with Plasma's caching. To make sure you are running the latest version of your theme after updating its files, clear the cache:

rm -r ~/.cache/plasma*

Then restart the Plasma Shell. The easiest way to do so is by opening KRunner with Alt + Space and running:

plasmashell --replace

Theme Colors

  • You can provide a Plasma color scheme that will allow text, selected backgrounds and other items to blend well with your theme by supplying a colors file in your theme folder. See the colors file in the default theme for an example.

  • If the colors file is omitted, Plasma will use the current Plasma system colors.

Important

Theme SVGs will not be colorized unless they contain the hint-apply-color-scheme element.)

Hints and Tips

  • Even a pixel or two out of place can make a difference over hours of use. It may not be obvious at first glance but the user may intuitively pick up that something is "just not right" and give up using your theme.

  • In Inkscape, turn off stroke scaling when elements are resized. Inkscape may default to scaling the stroke of an element when changing its size. This may show up in the rendered Plasma Style as thin, barely-there lines that you can't seem to get rid of.

  • If you prefer raster editors like Krita and GIMP, create your theme in these programs first, then import them into Inkscape (drag and drop of the files works fine). If you're working on a background with multiple elements, like widgets/panel-background.svg or widgets/background.svg, crop the raster image into the different elements (top, bottom, right, etc.) and save as separate files before importing into Inkscape.

  • Don't forget to embed imported raster images. By default Inkscape will import these as linked images that will not show up in Plasma (to embed the images, go to Effects -> Images -> Embed All Images).

  • Remember that the border elements of backgrounds (top, right, bottom, left) are tiled if the hint-stretch-borders element is not present in the SVG.

  • Remember that the center element of backgrounds are stretched if the hint-tile-center element is not present in the SVG.

  • To control how much colorization will be applied by Plasma when using the hint-apply-color-scheme element, make sure the color (HSV) Value/Intensity is closer to 0 or 255 for less colorization, and closer to 127 for more colorization. So, for example, to keep shadows from being colorized, use a color (HSV) Value/Intensity of 0.

  • When testing the theme, if it looks like portions of a multi-element SVG are missing (missing borders, etc.), check the SVG again to make sure the element IDs are correct.

  • Do not use more advanced SVG features since they will not be rendered properly. If you want to add blur or something similar, consider pre-rendering to PNG, and then importing the PNG into the final SVG file.

  • Perform this quick sanity check for background SVGs to help troubleshoot annoying lines and gaps between elements:

    • topleft, top and topright elements should have the same height

    • topright, right and bottomright elements should have the same width

    • bottomleft, bottom and bottomright elements should have the same height

    • topleft, left and bottomleft elements should have the same width

To make renaming of the theme elements easier, it is possible to use an . See [Inkscape Extensions]({{< ref "theme-svg#inkscape-extensions" >}}) for how to install it.

video tutorial
Plasma Styles on the KDE Store
Inkscape extension provided by KSvg