DSH Web UI uses a neutral theme by default. On a KDE desktop, users already have an accent color configured. This plugin reads that color to match the desktop.
Core features¶
The plugin consists of two parts: the host part reads the configuration and returns the data, and the client part fetches the data via HTTP and applies the theme.
- Read the KDE configuration file (
~/.config/kdeglobals) - Read the KDE color scheme file
- Apply the KDE system accent color to DSH Web UI
- Provide the API endpoint
/api/kde-tint/kde-colors - Support automatic application of different tints for light/dark mode
Installation and enablement¶
The official installation command is as follows:
dsh plugin --profile web add github:iwinoid/dsh-kde-tint
For local development, use the link installation method:
dsh plugin --profile web add link:/path/to/dsh-kde-tint
The plugin configuration sets immediately: true, so it takes effect immediately when loaded and requires no manual configuration. After installation, restart dsh web to see the effect.
Typical usage¶
Use curl to access the API endpoint and retrieve the current KDE color configuration:
curl http://localhost:<dsh-port>/api/kde-tint/kde-colors
The response is in JSON format and includes the accent color, background color, and scheme name.
Applicable scenarios and notes¶
- Platform limitation: Linux platform only.
- Fallback mechanism: On non-KDE systems, it falls back to the default color (
#386798) and the default scheme (KlassyDark). The plugin is designed not to block startup due to missing configuration files. - Communication method: Communication uses plain HTTP.
- Build dependencies: The client code is hand-written and has no build step.
This plugin integrates DSH Web UI with the KDE desktop environment, allowing interface colors to automatically sync with system settings.