This document contains critical technical context for building the Tailscale Plasma 6 widget safely and effectively.
- Never install to system root (
/usr/) during development. A bad install can break the Plasma desktop environment. - Always install locally to the user's home directory (
~/.local/). - In CMake, set the installation prefix to the local user directory if it's not handled automatically by
plasma_install_package. - Do not use
sudofor any build or install commands.
Fedora is currently using KDE Plasma 6. This means the widget must be built against Qt 6 and KDE Frameworks 6 (KF6).
The CMakeLists.txt must find the correct KF6 and Qt6 packages:
find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick)
find_package(KF6 REQUIRED COMPONENTS Plasma I18n CoreAddons Kirigami)To install the QML package, use the KF6 macro:
plasma_install_package(package org.kde.tailscale_widget)Be aware that imports have changed from Plasma 5.
- Use
import org.kde.plasma.plasmoidinstead of the oldPlasmaCore. - Use
import org.kde.kirigami as Kirigamifor standard UI components. - Use
import org.kde.kcmfor the configuration pages (configGeneral.qml).
Instead of installing the widget and restarting the entire Plasma shell to test it, use the plasmoidviewer tool. This runs the widget in a standalone window, preventing desktop crashes if the widget contains bugs.
- Command:
plasmoidviewer -a org.kde.tailscale_widget
When executing Tailscale commands via QProcess in the C++ backend:
- Do not run commands with elevated privileges. The Tailscale daemon provides user-level access to the CLI by default.
- Always sanitize or strictly control arguments passed to
QProcess(e.g., when switching profiles) to prevent arbitrary command execution.