Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/paulmcauley/klassy/llms.txt

Use this file to discover all available pages before exploring further.

Klassy is a comprehensive theming utility for KDE Plasma that consists of multiple integrated components. This document provides an architectural overview of how these components work together.

Project Overview

Klassy extends and enhances the Breeze theme with highly customizable window decorations, application styles, and visual elements. The project is built with C++20 and supports both Qt5 and Qt6 simultaneously.

Version Information

  • Current Version: 6.5.3
  • Qt5 Minimum: 5.15.2
  • Qt6 Minimum: 6.6.0
  • KF5 Minimum: 5.102.0
  • KF6 Minimum: 6.10.0
  • Plasma Requirement: 6.3+

Component Architecture

Klassy consists of several major components that work together to provide a unified theming experience:

KDecoration Plugin (kdecoration/)

The window decoration component provides the titlebar, window buttons, and window frames.Key Files:
  • breezedecoration.cpp/h - Main decoration logic (96KB+)
  • breezebutton.cpp/h - Window button rendering and behavior
  • breezesettingsprovider.cpp/h - Configuration management
Features:
  • Custom button rendering with multiple shape options
  • Configurable titlebar opacity and colors
  • Window outline styling
  • Shadow effects
  • Per-window exception rules
Dependencies:
  • KDecoration3 (KWin decoration API)
  • klassycommon6 (shared library)
  • KF6 frameworks (CoreAddons, GuiAddons, I18n, IconThemes, WindowSystem)
Installation:
Plugin: /usr/lib64/qt6/plugins/org.kde.kdecoration3/org.kde.klassy.so
Config: /usr/lib64/qt6/plugins/org.kde.kdecoration3.kcm/
Window decorations are only built for Qt6, not Qt5, as KWin uses Qt6.

Build System

Klassy uses CMake with a sophisticated dual-Qt-version build system.

Main CMakeLists.txt Structure

project(klassy)
set(PROJECT_VERSION "6.5.3")
set(CMAKE_CXX_STANDARD 20)

Build Functions

build_Qt5() Function:
  • Sets QT_MAJOR_VERSION to 5
  • Includes KDEInstallDirs5
  • Builds kstyle5 and libbreezecommon5
  • Output to kstyle5/ and libbreezecommon5/ directories
build_Qt6() Function:
  • Sets QT_MAJOR_VERSION to 6
  • Includes KDEInstallDirs6
  • Builds kstyle6, libbreezecommon6, and kdecoration
  • Conditionally builds decorations based on WITH_DECORATIONS option
  • Includes additional components: icons, layout-templates, look-and-feel, desktoptheme
  • Handles translations with ki18n_install(po)

Conditional Compilation

Components are conditionally compiled based on:
  • Available frameworks (KF5FrameworkIntegration, Qt5Quick, etc.)
  • Platform (decorations only on Unix-like systems, not macOS/Android)
  • CMake options (BUILD_QT5, BUILD_QT6, WITH_DECORATIONS)

Configuration System

Klassy uses KConfig’s XML-based configuration system.

Configuration Schema

The main configuration is defined in libbreezecommon/breezesettingsdata.kcfg (37KB+), which includes:
  • Button appearance (shape, size, icons, spacing)
  • Button colors (background, foreground, outline)
  • Button behavior (hover, click, animations)
  • Titlebar appearance (opacity, colors, margins)
  • Window outline style and colors
  • Shadow configuration
  • Exception rules
  • Animation settings

Live Configuration Updates

Changes are propagated via D-Bus:
  1. User changes settings in klassy-settings
  2. Settings saved to config file
  3. D-Bus signal emitted (dbusupdatenotifier.cpp)
  4. Active decorations and styles reload configuration
  5. Windows update appearance instantly

Rendering Pipeline

Button Icon Rendering

Buttons are rendered in two ways:
  1. Pixel-Perfect Icons (renderdecorationbuttonicon18by18.cpp):
    • Hand-crafted for 18×18 base size
    • Scaled for HiDPI
    • Multiple built-in styles
  2. Symbolic System Icons (renderdecorationbuttonicon.cpp):
    • Uses window-*-symbolic icons from system theme
    • Allows third-party icon themes
    • Color-adjusted to match settings

Color Calculation

Button colors (decorationbuttoncolors.cpp, 62KB+):
  • Can inherit from system color scheme
  • Support for accent color blending
  • Automatic contrast enhancement
  • Traffic light colors (red, yellow, green)
  • Translucent outline modes
  • Per-button customization

Shadow Rendering

breezeboxshadowrenderer.cpp implements efficient box-shadow rendering:
  • Gaussian blur approximation
  • Cached shadow textures
  • Different shadows for active/inactive windows
  • Configurable size, offset, and strength

Directory Structure

klassy/
├── CMakeLists.txt              # Main build configuration
├── README.md                   # Project documentation
├── AUTHORS                     # Author information
├── install.sh                  # Installation script
├── uninstall.sh                # Uninstallation script
├── kdecoration/                # Window decoration plugin (Qt6)
│   ├── config/                 # Decoration configuration UI
│   │   ├── ui/                 # Qt UI files
│   │   └── presets/            # Built-in preset files
│   ├── breezebutton.cpp/h      # Button implementation
│   └── breezedecoration.cpp/h  # Main decoration
├── kstyle/                     # Application style plugin (Qt5/6)
│   ├── animations/             # Animation engines
│   ├── config/                 # Style configuration (Qt6 only)
│   ├── debug/                  # Widget explorer
│   └── breezestyle.cpp         # Main style implementation
├── libbreezecommon/            # Shared library (Qt5/6)
│   ├── breezesettingsdata.kcfg # Configuration schema
│   ├── decorationbuttoncolors.cpp
│   ├── renderdecorationbuttonicon*.cpp
│   ├── presetsmodel.cpp
│   ├── style*.cpp              # Button style implementations
│   └── systemicontheme.cpp
├── colors/                     # Color scheme files
├── look-and-feel/              # Global theme definitions
├── desktoptheme/               # Plasma widget themes
├── layout-templates/           # Desktop layout definitions
├── icons/                      # System icon themes
│   ├── klassy/                 # Light icons
│   └── klassy-dark/            # Dark icons
├── po/                         # Translations
└── cmake/                      # CMake modules

Data Flow

1

User Interaction

User opens klassy-settings or System Settings KCM
2

Configuration Change

User modifies settings (button colors, spacing, etc.)
3

Save to Config

Settings written to KConfig files in ~/.config/
4

D-Bus Notification

dbusupdatenotifier emits signal about configuration change
5

Reload Configuration

All active decorations and styles receive signal and reload settings
6

Re-render

Windows update appearance using new configuration:
  • Button colors recalculated (decorationbuttoncolors.cpp)
  • Icons re-rendered (renderdecorationbuttonicon*.cpp)
  • Geometry updated (geometrytools.cpp)
  • Decorations repainted (breezedecoration.cpp)

Extension Points

Adding New Button Styles

  1. Create new style class in libbreezecommon/style*.cpp
  2. Inherit from base button rendering interface
  3. Implement icon rendering methods
  4. Add to preset system in presetsmodel.cpp
  5. Update configuration UI

Adding New Presets

  1. Create preset file in kdecoration/config/presets/
  2. Define all configuration values
  3. Add preset metadata (name, description, author)
  4. Preset automatically appears in klassy-settings

Custom Color Schemes

  1. Create .colors file in colors/ directory
  2. Define all color roles for light/dark modes
  3. Install to /usr/share/color-schemes/

Testing and Debugging

Build with testing enabled:
cmake -DBUILD_TESTING=ON ..

Debug Output

Logging category: klassy5 or klassy6 Enable debug output:
QT_LOGGING_RULES="klassy6.debug=true" klassy-settings

Widget Explorer

The debug widget explorer (debug/breezewidgetexplorer.cpp) helps identify widget types and properties for styling.

Internationalization

Translations use KDE’s ki18n framework:
  • Translation domain: klassy_kwin_deco
  • Source strings extracted from C++ code
  • Translations stored in po/ directory
  • Compiled .mo files installed system-wide
Current translations:
  • French (po/fr/)

Performance Considerations

  • Shadow caching: Shadows are pre-rendered and cached
  • Color caching: Button colors calculated once per state change
  • Icon caching: Rendered icons cached by size and style
  • Lazy loading: Configuration only loaded when needed
  • D-Bus efficiency: Configuration updates use signals, not polling
  • Animation optimization: GPU-accelerated where possible
Klassy is designed for efficiency with minimal performance impact. The common library ensures code sharing between Qt5 and Qt6 builds.

Build docs developers (and LLMs) love