Chuyển đến nội dung chính

dsh-wallpaper-theme

Đã xác minh

@midnightbell/dsh-wallpaper-theme · v1.0.1 · MIT · Giao diện web

DSH 背景壁纸主题插件:设置页「背景主题」入口,渐变预设/本地图片/剪贴板/图片链接,设置持久化到 DSH_HOME,重启自动恢复。

Cài đặt

dsh plugin add @midnightbell/dsh-wallpaper-theme

Xác nhận layer đã áp bằng dsh --profile default --dump-config — xem hướng dẫn cài plugin.

Mã nguồn

Phát hành lên npm mà không có repository công khai. Hãy kiểm tra nội dung package trước khi cài.

Thẻ

Readme

@midnightbell/dsh-wallpaper-theme

DSH 背景壁纸主题插件 —— 在 Web 表面(设置页)新增「背景主题」入口:

  • 5 个内置渐变预设(极光 / 暮色 / 深海 / 晨曦 / 暮林)
  • 本地图片(文件选择或剪贴板粘贴)
  • 任意图片 URL
  • 遮罩强度与沉浸模式(侧栏通透)
  • 设置持久化到 $DSH_HOME.dsh-wallpaper-settings.json + .dsh-wallpaper-bg.b64),重启自动恢复

安装(用户)

需要 pnpm 和 DSH(dsh 命令在 PATH 上)。

# 1. 安装插件(会自动加入 profile 的 bundle 层,无需手改配置)
dsh plugin --profile web add @midnightbell/dsh-wallpaper-theme

# 2. 重启 DSH(关掉服务/窗口后重新打开)

升级:

dsh plugin --profile web update @midnightbell/dsh-wallpaper-theme

卸载:

dsh plugin --profile web remove @midnightbell/dsh-wallpaper-theme

非 web 表面(如 headless)不会加载本插件(dsh.client.platform: "web")。

原理

  • Host 端(lib/index.js,ESM 默认导出):注册 /wallpaper-api JSON 接口,读写 $DSH_HOME 下的设置与本地图片文件。
  • Client 端(lib/client.js):经 dsh.client + exports["./client"] 由 DSH 的 client-modules 机制按请求提供;在设置页注入「背景主题」区块。
  • 包声明 dsh.bundle.patch,因此 dsh plugin --profile web add 安装后会自动进入该 profile 的 dsh.profile.bundles,其补丁层自动插入插件行。

开发 / 发布

# 本地打包检查
npm pack --dry-run

# 发布
npm login
npm publish --access public

License

MIT