Kvantum SVG-based Theme Engine

repository·master·Indexed 24 days ago

https://github.com/tsujan/kvantum

An SVG-based theme engine for Qt designed for KDE and LXQt desktop environments. Kvantum allows for highly customizable visual styles, including photorealistic, 3D, flat, or minimalistic designs, by using SVG images to draw Qt widgets. It includes the Kvantum Manager for theme configuration and a CLI for global theme setting and application-specific assignments.

Tokens
1.6K
Snippets
3
Records
12
Agent score
76%

What's inside Kvantum

  1. Overview of Kvantum theme engine

    master
    Kvantum is an SVG-based theme engine for Qt, specifically optimized for KDE and LXQt environments. It uses SVG images to draw Qt widgets, allowing for a wide range of visual styles including photorealistic, 3D, flat, or minimalistic designs. It provides high control over almost every aspect of Qt widget appearance.
  2. Configure KWin blur effects with Kvantum

    master

    Kvantum can control KWin's blur effect for translucent backgrounds, menus, tooltips, and specific windows (like Konsole or QTerminal).

    Requirements & Best Practices:

    • Enable Blur in KWin: Kvantum's blur options only work if the KWin compositor's blur effect is already enabled.
    • Avoid Double Compositors: Under X11, never run two compositors simultaneously. KWin is highly recommended.
    • Non-KWin Compositors: If using a compositor other than KWin, it is best to disable menu/tooltip shadows and blurring, as they may not distinguish Kvantum's shadows correctly. You can use the Shadowless menus and tooltips option in Kvantum Manager → Configure Active Theme → Compositing & General Look as a workaround.
  3. Apply Kvantum themes in Desktop Environments

    master

    KDE Plasma

    1. Go to System Settings → Application Style → Widget Style and select Kvantum.
    2. Go to System Settings → Color → Scheme and select your desired scheme.
    3. Log out and back in for changes to take full effect.

    LXQt

    1. Go to Configuration Center → Appearance → Widget Style and select kvantum.
    2. Use Kvantum Manager from the Configuration Center to change specific themes.
    3. Workaround for shadows: If your compositor adds unwanted shadows to menus/tooltips, enable Kvantum Manager → Configure Active Theme → Compositing & General Look → Shadowless menus and tooltips.

    Other Desktop Environments

    It is highly recommended to use a Qt configuration utility to select Kvantum. If you must do it manually:

    • Per-application: Run APP -style kvantum.
    • Global (Environment Variable): Set QT_STYLE_OVERRIDE=kvantum.
      • X11: Add export QT_STYLE_OVERRIDE=kvantum to ~/.profile or ~/.bashrc.
      • GNOME/Other: Create ~/.config/environment.d/qt.conf with the content QT_STYLE_OVERRIDE=kvantum and reboot.
    export QT_STYLE_OVERRIDE=kvantum
  4. Compile Kvantum from source

    master

    To build Kvantum manually, ensure you have the necessary prerequisites (GCC, X11, and Qt6) installed for your distribution.

    Build Steps

    mkdir build && cd build
    cmake ..
    make

    Important CMake Options

    • Installation Prefix: On some distributions, use cmake .. -DCMAKE_INSTALL_PREFIX=/usr to avoid installing to /usr/local, which can cause issues.
    • Disable KWin effects: If you do not need KWin effects (like blur), use -DWITHOUT_KF=ON to avoid the kwindowsystem dependency.
    • Enable Qt5 support: To compile the Qt5 plugin, use -DENABLE_QT5=ON. Note that this requires the Qt5 counterparts of the required packages plus qt5-x11extras (or your distro's equivalent dev package).
    mkdir build && cd build
    cmake ..
    make
  5. Install Kvantum on various Linux distributions

    master

    Kvantum can be installed via package managers or compiled from source.

    Arch-based

    • Stable: sudo pacman -S kvantum
    • Git (preferred): yay -S kvantum-qt6-git (using yay as an example)

    Debian-based (Ubuntu)

    Add the Papirus PPA and install both the style and the themes:

    sudo add-apt-repository ppa:papirus/papirus
    sudo apt update
    sudo apt install qt6-style-kvantum qt6-style-kvantum-themes

    Gentoo-based

    Unmask x11-themes/kvantum if using a stable branch, then:

    sudo emerge --ask --verbose x11-themes/kvantum

    openSUSE

    • Tumbleweed: sudo zypper refresh && sudo zypper install kvantum-manager kvantum-qt6
    • Leap: Requires compilation.

    Red Hat-based (Fedora)

    sudo dnf install kvantum

    NixOS

    To install the Qt5-based version, add to configuration.nix:

    environment.systemPackages = with pkgs; [ libsForQt5.qtstyleplugin-kvantum ];
    sudo pacman -S kvantum
  6. Understand the role of Kvantum.colors

    master

    The Kvantum.colors file is a color scheme designed for KDE applications that consume KDE-specific color settings directly. While color schemes are generally considered part of the user settings for KDE style engines, certain KDE apps rely on these specific files for their appearance.

    Kvantum.colors is automatically installed as part of the default Kvantum theme. Additional color schemes are located in themes/colors/ and are intended to be used in conjunction with extra themes.

  7. Theme installation paths and priorities for theme makers

    master

    Kvantum themes can be installed as a user or as root.

    User Installation (Highest Priority)

    Themes installed in these locations take priority over root installations. The priority order (highest to lowest) is:

    1. ~/.config/Kvantum/$THEME_NAME/
    2. ~/.themes/$THEME_NAME/Kvantum/
    3. ~/.local/share/themes/$THEME_NAME/Kvantum/

    To ensure Kvantum Manager installs KDE color schemes automatically, include $THEME_NAME.svg, $THEME_NAME.kvconfig, and $THEME_NAME.colors in the theme folder.

    Root Installation

    If PREFIX=/usr, the possible paths are:

    1. /usr/share/Kvantum/$THEME_NAME/ (Highest priority)
    2. /usr/share/themes/$THEME_NAME/Kvantum/

    KDE color schemes for root installations should be placed in /usr/share/color-schemes/.

  8. Kvantum Manager CLI Reference

    master

    The following command-line flags are supported by kvantummanager:

    FlagDescription
    --help, -hDisplays usage information and available commands.
    --version, -vDisplays the name and version of Kvantum Manager.
    --set THEMESets the active Kvantum theme globally.
    --assign THEME APP1 APP2 ...Assigns a specific theme to one or more applications. APP1, APP2, etc., must be the names of the executables.
    --noAssign THEMERemoves theme assignments associated with the specified theme.
    --noAssign-AllRemoves all current theme assignments.
  9. Use the Kvantum Manager CLI

    master

    The kvantummanager command-line interface allows you to configure Kvantum themes, activate them globally, or assign specific themes to individual applications without opening the GUI.

    Important Note: If you use command-line options, ensure the Kvantum Manager GUI is closed, as the GUI will not automatically reflect changes made via the CLI.