dsh-kde-tint
界面增强 活跃维护

dsh-kde-tint

iwinoid/dsh-kde-tint

读取 KDE Plasma 的系统强调色,自动注入 Web 界面的配色变量,按钮、选中态与高亮随系统配色实时同步;改完颜色刷新即生效,无需手动维护主题文件,轻量脚本即可挂载。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
JavaScript
主要语言
MIT
开源协议
8 KB
仓库大小
2 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:iwinoid/dsh-kde-tint
git clone https://github.com/iwinoid/dsh-kde-tint.git
git clone git@github.com:iwinoid/dsh-kde-tint.git
README.md main

dsh-kde-tint

standard-readme compliant
License: MIT
topic: dsh-plugin
powered by dsh
Platform: Linux

Tint the DSH web UI with the KDE system accent color.

Table of Contents

Background

The DSH web UI ships a neutral theme. On a KDE desktop the user already picks an accent color in System Settings. This plugin reads that color and tints the DSH interface with it. The harness then matches the desktop.

The plugin has two halves. The host half (lib/index.js) reads ~/.config/kdeglobals and the active color-scheme file. It serves the result as JSON from the profile web server. The browser half (lib/client.js) fetches the JSON and applies the tint through the theme service. The two halves talk over plain HTTP. A static client bundle has no host bridge, so HTTP is the correct channel.

On systems without KDE configuration the plugin falls back to defaults (accent #386798, scheme KlassyDark). It never blocks startup because of a missing config file.

Install

dsh plugin --profile web add github:iwinoid/dsh-kde-tint

Local development uses a link install instead:

dsh plugin --profile web add link:/path/to/dsh-kde-tint

The package has no build step, so a git install needs no allowBuilds exception. The package ships cordis.patch.yml through dsh.bundle.patch, so the loader mounts it with no manual patch step. Restart dsh web after install.

Check the install:

dsh --profile web --dump-config | grep -A3 kde-tint

Then open the DSH web UI. The background and borders carry a tint of the KDE accent color.

Usage

The plugin needs no clicks. It loads with immediately: true and tints the UI on every page load. Uninstall (or disable) restores the stock theme. The token override is effect-scoped, so it unwinds with the plugin.

What gets tinted

The client mixes the KDE accent into the base surfaces. Light mode keeps a white base with 6–16% accent. Dark mode keeps a dark base with 6–8% accent. Brand primary uses the raw accent in both modes.

Token Light Dark
--dsw-alias-bg-base white + 6% accent #0a0f14 + 8% accent
--dsw-alias-bg-layer-1 / sidebar fill white + 8% accent #11161c + 7% accent
--dsw-alias-bg-layer-2 white + 11% accent #1a2028 + 6% accent
--dsw-alias-bg-layer-3 white + 14% accent #232d37
--dsw-alias-border-l1 / -l2 white + 12% / 16% accent #2a323d / #303a47
--dsw-alias-brand-primary raw accent raw accent

Text tokens stay neutral (#1a1d22 / #e6e8eb primary). Only surfaces and brand follow the accent.

API

Debug endpoint on the profile web server:

curl http://localhost:<dsh-port>/api/kde-tint/kde-colors

GET /api/kde-tint/kde-colors returns 200 with JSON:

{ "accent": "#386798", "background": "#ffffff", "scheme": "KlassyDark" }

accent comes from General.AccentColor in kdeglobals (RGB triple or #hex). scheme comes from General.ColorScheme. background comes from Colors:Window.BackgroundNormal (or Colors:View) in the scheme file. When the read fails, the response still returns 200 with the default values plus an error string. Unknown routes return 404.

Maintainers

Contributing

Bug reports and questions are welcome on the GitHub Issues page. Pull requests are accepted. The client bundle is hand-written with no build step. Keep it that way.

License

MIT © iwinoid