marlonLau/dsh-wallpaper-engine
基于本地Wallpaper Engine图片/视频的一键DSH背景切换器
Project Overview项目介绍
A DSH plugin that applies wallpapers from a local Wallpaper Engine library (images/videos) to the DSH Web GUI background, with optional auto-switching between dark and light themes. It uses the Wallpaper Engine Web API and falls back to scanning Steam workshop and project directories. Images render as CSS backgrounds, videos loop muted, while 3D scenes and web wallpapers show a static preview. Note: 3D and web wallpapers cannot run live inside DSH.
DSH 一键换背景插件:从本机 Wallpaper Engine 素材库(图片/视频)选取并应用到 DSH Web GUI 背景,可联动切换深/浅色主题。支持 WE Web API 与本地目录扫描回退,图片用 CSS 背景、视频静音循环、3D/网页壁纸用预览图,应用后界面变半透明毛玻璃。注意:3D 与网页壁纸仅静态展示,无法在 DSH 内实时渲染。
请帮我了解并安装插件:【dsh-wallpaper-engine】【https://github.com/marlonLau/dsh-wallpaper-engine】
Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add @marlonlau/dsh-wallpaper-engine
把 marlonLau/dsh-wallpaper-engine 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-wallpaper-engine
DSH Web GUI 的一键换背景插件:从本机 Wallpaper Engine 素材库(图片 / 视频,目前只支持这2种)里选一张,一键应用到 DSH 界面背景,并可联动切换 DSH 深/浅色主题。
功能
- 壁纸库:侧边栏底部按钮打开选择面板(缩略图网格 + 搜索)。
- 两种素材来源(
/we/list?source=auto自动选择):- Wallpaper Engine Web API:WE 自带的本地 Web 服务(默认
http://localhost:26384/api/wallpaper/list),仅在 WE 运行且其本地 Web 服务可用时生效;未启用/不可用时自动回退目录扫描; - 目录扫描(回退):自动发现所有 Steam 库(读取注册表 +
libraryfolders.vdf),扫描steamapps/workshop/content/431960/*(创意工坊)和steamapps/common/wallpaper_engine/projects/myprojects/*(本地项目),解析project.json。
- Wallpaper Engine Web API:WE 自带的本地 Web 服务(默认
- 一键应用:图片 → CSS 背景;视频 → 静音循环
<video>;3D 场景 / 网页壁纸 → 用其preview.jpg静态展示。应用后 App 框架与侧边栏变为半透明 + 毛玻璃(backdrop-filter),壁纸透出。 - 明暗跟随:勾选后按壁纸亮度自动切换 DSH 深色 / 浅色主题(
theme.setTheme)。 - 持久化:当前壁纸与设置存
localStorage,刷新不丢;额外目录等配置存$DSH_HOME/storages/dsh-wallpaper-engine.json。 - 随机 / 关闭背景:一键随机换,或一键恢复 DSH 默认背景。
功能展示



安装(以 web profile 为例)
从 npm 安装(推荐)
dsh plugin --profile web add @marlonlau/dsh-wallpaper-engine
该命令会写入依赖,并自动把包追加进 dsh.profile.bundles;随后重启 dsh web 生效(客户端改动刷新页面即可)。
从 GitHub 仓库安装(开发调试)
插件包已在 npm 发布,仓库安装仅供开发调试(需要 Node.js >= 18 与 git):
# 1. 克隆仓库
git clone https://github.com/marlonLau/dsh-wallpaper-engine.git
cd dsh-wallpaper-engine
# 2. 把插件包链接进 web profile(本插件为单包、零依赖、无构建步骤)
dsh plugin --profile web add "link:$PWD"
# 3. 重启 dsh web
dsh web
等价手动方式:在 profile 的
package.json里加依赖"@marlonlau/dsh-wallpaper-engine": "link:<仓库绝对路径>",并把它追加进dsh.profile.bundles,然后pnpm install。
宿主路由
| 路由 | 说明 |
|---|---|
GET /we/list |
壁纸列表(source=auto|api|scan,refresh=1 强制重扫) |
GET /we/status |
API 可用性 / 根目录 / 数量诊断 |
GET /we/file?p=… |
媒体文件(图片/视频,支持 HTTP Range) |
GET /we/preview?p=… |
预览缩略图 |
GET/POST /we/config |
配置(额外目录、API 地址、API 开关) |
所有路由有回环/内网信任围栏;文件路由只允许壁纸项目目录内的媒体扩展名。
开发
- 宿主半区:
lib/index.js(Node,inject: ['webServer']) - 客户端半区:
lib/client.js(浏览器,inject: ['theme', 'workspaces'],手写 CJS bundle,window.__ModuleLoader__.load(...)) - 改
lib/client.js后刷新页面即可生效;改lib/index.js需重启dsh web。
仓库
- 源码:https://github.com/marlonLau/dsh-wallpaper-engine
- npm:https://www.npmjs.com/package/@marlonlau/dsh-wallpaper-engine
后续可做
- 通过 WE API
POST /api/wallpaper/set联动设置 Windows 桌面壁纸 - 定时轮换 / 播放列表
- 毛玻璃强度、暗化程度可调
liustack/modlens
Lum1104/dsh-browser
elysia395/dsh-wallpaper-engine
starsstreaming/beautiCode
plolpl789/dsh-raw-html
Tkingxiao/dsh-any-background
sz1698/dsh-bg-new
TQSY114514/dsh-ui-appearance