dsh-wallpaper-bridge
把 Wallpaper Engine 的壁纸真正铺满 DeepSeek Harness 的网页界面。
一个 DSH 插件:它跟随 dsh-plugin-wallpaper-engine 的当前选择
(图片 / 视频 / 场景实时渲染 / 网页壁纸),把画面铺满整个窗口,并把 DSH 的 UI 面层做成半透明 ——
不依赖桌面壳的 extended 模式。
English · 工作原理 · 安装 · 调试 API · 已知限制
它解决什么问题
DSH 社区壁纸插件把"界面透明化"这一步交给桌面壳:页面 URL 上的
?dsh-desktop-mode=extended|advanced。壳没传这个参数时(不少版本就是没有),插件回落到
compatibility 模式,外壳材质规则整段不生效 ——
结果是:插件日志里 apply 明明成功了,画面上却一个像素都不显示,壁纸被不透明的面层整个盖住。
本插件不依赖壳层,直接在页面内部把面层做透,所以在这种环境下也能出画面。
实测(同一台机器、同一张壁纸,开关对照):
| 指标 | 壁纸关 | 壁纸开 |
|---|
| 整窗 RGB 均值 | (16.7, 23.2, 43.4) | (35.2, 38.5, 46.4) |
| 整窗方差 | 31.3 | 55.0 |
| 与"壁纸关"的差分 | — | 平均 29.7 / 峰值 252 / 91.2% 像素发生变化 |
特性
- 跟随壁纸库选择:每 5 秒 + 页面重新可见时复查一次,在壁纸库里点哪张就铺哪张。
- 按类型选最合适的渲染方式:
| 壁纸类型 | 渲染方式 |
|---|
image | <img>(宿主 media 路由) |
video | <video loop muted autoplay> |
scene(pkg 内嵌 MP4) | <video>,硬件解码 |
scene(没有内嵌 MP4) | 嵌引擎自己的 WebGL 实时渲染页(清晰、能动) |
web | <iframe> |
| 都没有 / 未选择 | 可选的内联兜底图 |
- UI 面层透明化:把主题的 5 个背景别名 token(
--dsw-alias-bg-base / bg-layer-1 /
bg-layer-2 / bg-overlay / --dsw-specific-sidebar-fill)换成同色 + 半透明版本,
并让 html/body/#root 透明。先临时禁用自家样式表读出主题原色再换算 —— 所以浅色 / 深色主题都不会串味。
- 按壁纸亮度自适应可读性:把当前画面缩到 32×18 采样平均亮度,越亮则面板越实、整体压暗越重,
保证换成一张高亮壁纸时文字依然读得清。
- 低清兜底有柔焦:WE 的
preview 往往只有 160–192 px,拉满 1440p 会很糊 ——
兜底时自动加 blur(30px),宁可"有意的柔背景",也不要"拉糊的马赛克"。
- 页面隐藏时暂停视频,省 CPU。
- 零依赖:浏览器半是单文件、无构建工具链;构筑脚本只用 Node 内置模块。
安装
需要先装 dsh-plugin-wallpaper-engine(提供壁纸库与媒体路由)以及一份 DSH ≥ 0.2.0-rc.1。
方式 A:直接从仓库装(仓库里已提交构筑好的 client.js,无需本地构建)
dsh plugin --profile desktop add github:late-autumn-gif/dsh-wallpaper-bridge
方式 B:本地构建后装 tgz
git clone https://github.com/late-autumn-gif/dsh-wallpaper-bridge.git
cd dsh-wallpaper-bridge
node scripts/build.mjs # 生成 client.js(仓库里已有一份默认的)
npm pack # 打出 dsh-plugin-wallpaper-bridge-1.0.0.tgz
dsh plugin --profile desktop add ./dsh-plugin-wallpaper-bridge-1.0.0.tgz
想让"没有选中任何壁纸"时也有一张底图,构筑时内联一张你自己的图:
node scripts/build.mjs --wallpaper=./my-wallpaper.webp
内联的图必须是你有权使用的。本仓库不附带任何素材,请勿把他人作品打进包里分发。
装完重启一次 DSH(见下方限制),然后打开 设置 → Wallpaper Engine → 壁纸库,点选任意一张。
调试 API
页面控制台:
__wpBridge.refresh() // 立刻重读壁纸库选择,不等 5 秒轮询
__wpBridge.current() // 当前生效的条目 + 渲染方式
__wpBridge.enable() // 打开
__wpBridge.disable() // 关掉(界面恢复原生不透明),可用来做开关对照
工作原理
三层,互相独立、都可单独关闭:
- 透明化:注入一条
!important 的样式表覆盖 5 个背景 token + 让根节点透明。
每次重算前先把自己的样式表 disabled = true,用 getComputedStyle 读出主题原色,
再换成 rgba(同色, α) —— 所以主题切换(明/暗、注册主题)不会把配色弄坏,
靠 MutationObserver 盯 html/body 的属性变化自动重算。
- 壁纸层:body 第一个子节点上一个
position:fixed; z-index:0 的容器,
里面按候选链挂一个媒体节点(img / video / iframe),外层再叠一层渐变压暗
(左侧更重,因为侧栏与标题都在左边)。
- 候选链:任何一个源加载失败(
error 事件)就自动往下一个退,
所以某张壁纸的编码不被支持、或场景渲染页起不来时,不会只剩黑屏。
场景实时渲染页的 URL 与引擎客户端 liveRenderUrl() 完全一致:
/wallpaper-engine/scene-live/index.html
?type=scene&fit=cover&sceneFps=30&muted=true
&src=<sceneLiveSrc>
&mediaBase=<inventory.sceneMediaBase + /wallpaper-engine/scene-files>
已知限制
- 升级插件后需要重启一次 DSH。DSH 只把新模块推给已打开的页面,同名模块的升级不会热推送;
而这个 Electron 壳又禁用了 F5 / Ctrl+R / Ctrl+Shift+R。首次安装是立即生效的。
- 只在
dsh.client.platform = web 的 profile(桌面端 / dsh web)里有意义。
- 依赖
dsh-plugin-wallpaper-engine 的 HTTP 路由(/wallpaper-engine/*,同源、无需鉴权)。
没装或停用该插件时,本插件只会保留透明化与可选的内联兜底图。
- 场景实时渲染需要把
scene.pkg(常见 20–90 MB)拉到渲染页,首次切换会有等待,
且会占用 GPU/CPU;这是引擎自己的渲染链,本插件只是把它嵌进来。
生态里的其他壁纸插件
本插件不做壁纸管理(不上传、不转码、不建库),只做"把选中的壁纸真正画出来"这一件事。
许可
代码 MIT © 2026 late-autumn-gif。
本仓库不包含任何第三方素材;--wallpaper= 内联的图片由使用者自负版权责任。
English
dsh-wallpaper-bridge renders the wallpaper you picked in
dsh-plugin-wallpaper-engine as a real
full-screen background inside the DeepSeek Harness web UI — without depending on the desktop
shell's extended mode.
Community wallpaper plugins delegate UI transparency to the desktop shell via
?dsh-desktop-mode=extended|advanced. When the shell doesn't pass that parameter, they fall back to
compatibility mode, the shell-material rules never apply, and the wallpaper is fully covered by
opaque surfaces — zero pixels visible, even though the plugin logs a successful apply.
This plugin does it from inside the page instead:
- overrides the five background alias tokens with same-hue translucent values (reading the theme's
original colors first, so light/dark themes both keep working) and makes
html/body/#root
transparent;
- mounts a fixed wallpaper layer that follows the wallpaper library's current selection
(image →
<img>, video → <video>, scene with an embedded MP4 → <video>,
scene without one → the engine's own WebGL live-render page in an <iframe>, web → <iframe>);
- adapts panel opacity to the wallpaper's brightness so text stays readable.
Measured with the wallpaper toggled off/on: 91.2% of pixels change, window variance goes from
31.3 to 55.0.
Install: node scripts/build.mjs && npm pack, then
dsh plugin --profile desktop add ./dsh-plugin-wallpaper-bridge-1.0.0.tgz, then restart DSH once
(DSH only hot-pushes brand-new client modules, and this Electron shell disables F5/Ctrl+R).
MIT licensed. No third-party assets are bundled.