Skip to content
dsh.fish
Bundle

dsh-web-skin

Permanent wallpaper skin for the DSH web UI: the host serves any local image over an HTTP route, the client pins it behind the window, makes theme surfaces translucent, and offers a Settings → 背景图 panel to change the image anytime — survives restarts, no re-define needed.

Source
SnoWinKK
stars
1 stars
License
MIT
Updated
Updated 14 days ago

Readme

# dsh-web-skin 🖼️

给 **DSH Web 界面**(浏览器里的 DSH)铺壁纸的插件:**设置 → 背景图** 输入本地图片路径即时换图,
侧栏、对话框变成**半透明玻璃感**,壁纸从界面下面透出来。挂进 profile 后**重启不丢、无需任何 agent 操作**。

## ✨ 功能

- 🖼️ **任意本地路径换图**:输入 `C:/Users/you/wallpaper.png` 这类路径 → 应用,即时生效(≤ 8MB)
- 🌗 **玻璃半透明**:主题底色 token 覆盖为半透明,浅色/深色主题自适应,壁纸从 UI 下透出
- 💾 **路径持久化**:存在 localStorage,重启自动恢复上次的图
- ↩️ **一键恢复默认**:随时切回默认图
- 🔒 **隐私安全**:图片只在本机传输,不上传、不联网

## 安装(给使用者,三选一)

### 方式 A:让 DSH 的 AI 帮你装(最简单)

把这句话发给你的 DSH:

> 帮我安装 dsh-web-skin 插件,代码在 `github:SnoWinKK/dsh-web-skin`

### 方式 B:命令安装(需要 `dsh` 和 `pnpm`)

```powershell
# 直接从 GitHub 安装:
dsh plugin --profile <profile> add github:SnoWinKK/dsh-web-skin

# 或者:clone 下来后用本地文件夹安装:
git clone https://github.com/SnoWinKK/dsh-web-skin
cd dsh-web-skin
dsh plugin --profile <profile> add .
```

然后**重启 DSH**。`dsh plugin` 会自动把插件加进 profile 的 bundles,无需手改配置。

> 💡 **`<profile>` 填什么?**
> - 用 **Deepseek-Harness-Desktop 桌面版** → 填 `desktop`
> - 用官方 **`dsh web` 网页版** → 填 `web`
> - **不确定的话**:打开 `C:\Users\你的用户名\.dsh\profiles` 文件夹,里面的文件夹名就是可用的 profile 名
> - **填错不会弄坏东西**:只是装进另一套配置。重启后没生效,就换一个名字再跑一次命令

### 方式 C:手动编辑 profile(不装 dsh CLI)

1. 拿到本仓库(Download ZIP 解压即可);
2. 编辑 `~/.dsh/profiles/<profile>/package.json`:

   ```json
   {
     "dependencies": { "dsh-web-skin": "link:<解压后的路径>" },
     "dsh": { "profile": { "bundles": [/* ... */, "dsh-web-skin"] } }
   }
   ```

3. 在 profile 目录跑 `pnpm install`,重启 DSH。

## 使用

- **换图**:设置 → **背景图** → 输入本地图片路径 → 应用;恢复默认 → 输入留空点「恢复默认」
- **默认图**:默认**没有内置图**——「恢复默认」会尝试工作区根目录的 `wallpaper.jpg`;想自定义默认图就把 `lib/index.js` 顶部的 `DEFAULT_IMG` 改成你的图片路径
- **可选插件行配置**:`config: { "path": "C:/..." }` 预设初始路径

## 工作原理

```
┌─ Host(Node 进程)──────────────────────────────────┐
│  webServer.register('/dsh-web-skin/bg')             │
│  fs.resolve + fs.readBytes 读取本地图片(沙箱化)    │
└───────────────┬──────────────────────────────────────┘
                │ 同源 HTTP:GET /dsh-web-skin/bg?path=…
┌───────────────▼──────────────────────────────────────┐
│ Client(浏览器)                                      │
│  fetch → blob → data URL → <html> 背景图 !important   │
│  theme.overrideTokens:底色 token → 半透明(玻璃感) │
│  settings.section:注册「背景图」设置面板             │
│  localStorage 持久化路径,重启自动恢复                │
└──────────────────────────────────────────────────────┘
```

## 结构

- `lib/index.js` — Node 半:注册 `/dsh-web-skin` HTTP 路由,沙箱化读图
- `lib/client.js` — Client 半(`__ModuleLoader__` 格式):注入壁纸 + 主题半透明 + 设置面板
- `cordis.patch.yml` — 宿主合成补丁

## 许可

MIT。

Install

dsh plugin --profile web add github:SnoWinKK/dsh-web-skin

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source