dsh-wallpaper
DSH wallpaper plugin: choose an image/gradient as the DSH web background, with local-folder browsing, crop, blur, dim, panel translucency and position controls.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:RNlao/dsh-wallpaper说明文档
阅读完整 README ↗dsh-wallpaper · DSH 壁纸插件
让用户在 DSH Web 界面更换背景图片的插件,支持:无壁纸、预设渐变、上传图片、导入文件夹、裁剪图片、模糊、遮罩、面板半透明、文字颜色/阴影、填充与位置调整。
图片作为真实文件保存到 DSH 配置文件夹 ~/.dsh/wallpaper/(原图、不压缩),不受浏览器存储 5MB 限制;选择与效果参数存 localStorage。
仓库结构
符合 DSH 插件格式的 npm 包(dsh.bundle + dsh.client 双面插件):
dsh-wallpaper/
├── package.json # dsh.bundle(自动装载)+ dsh.client(浏览器半)+ exports
├── cordis.patch.yml # bundle patch:insert 自己的 host 半
├── lib/
│ ├── index.js # host 半:Node fs 读写 ~/.dsh/wallpaper/ + webServer 路由
│ └── client.js # client 半:window.__ModuleLoader__.load 格式,实际 UI/逻辑
├── dynamic/ # 动态插件版本(cordis preset 临时运行用)
│ ├── client.js
│ └── host.js
└── README.md
安装(持久化)
本插件有 host 半(读写磁盘图片)和 client 半(界面)。安装时必须把它声明为 profile 的依赖(而非手动复制进 node_modules),DSH 从 profile 目录解析插件时才能找到它:
cd ~/.dsh/profiles/web
pnpm add 'dsh-wallpaper@link:/path/to/dsh-wallpaper'
# 确认 dsh.profile.bundles 含 "dsh-wallpaper"(dsh plugin add 会自动加入;
# 手动安装则确认 package.json 里 dependencies 与 bundles 都声明了它)
# 重启 dsh web
也可用
dsh plugin --profile web add github:RNlao/dsh-wallpaper(内部即 pnpm add,会自动写入dependencies并 reconcile 进dsh.profile.bundles)。
关键点:
dsh-wallpaper必须同时出现在dependencies和dsh.profile.bundles里,且node_modules/dsh-wallpaper存在——否则 DSH 从 profile 目录 import host 半时抛ERR_MODULE_NOT_FOUND。全局npm install -g无效,Node ESM 不会从全局包解析。
重启后打开 设置(左下角)→ 壁纸 / Wallpaper。
原理:
dsh plugin add会把包装进 profile 的 node_modules 并 detect 到dsh.bundle.patch、自动加入dsh.profile.bundles(bundle patch 的insert由此生效);dsh-client-modules扫描dsh.client声明,通过/plugins/dsh-wallpaper/client.js提供浏览器半。host 半则必须额外链接到全局 node_modules——这是 DSH 全局安装下 loader 的模块解析要求(否则/dsh-wallpaper/*路由不注册,上传会失败)。host 半通过webServer暴露这些路由读写磁盘图片。
功能
- 无壁纸:恢复 DSH 原生外观(插件默认即此状态,不主动改变界面)。
- 预设:8 个内置渐变。
- 图片库:上传 / 导入文件夹 / 裁剪的图片进入图片库(缩略图网格、可删、点选设背景)。