Skip to content
dsh.fish
Bundle

dsh-bg-skin

背景皮肤:将 DSH 界面背景替换为随插件分发的默认图片(assets/ds.jpeg,安装即用),可选 imagePath 覆盖,缺图自动回退默认皮肤。

Source
jinzhengen964-cmyk
stars
1 stars
License
MIT
Updated
Updated 14 days ago

Readme

# dsh-bg-skin

DSH (DeepSeek Harness) 背景皮肤插件:把 DSH 界面的白色背景替换为图片,图片半屏居中、只覆盖对话区域,AI 输出卡片保持不透明便于阅读。**默认皮肤是随插件分发的 `assets/ds.jpeg`——安装即见,无需任何配置;可选 `imagePath` 换成你自己的图,删除图片后自动回退默认皮肤,插件始终可用。**

## 功能

- 🖼️ 默认使用随插件分发的 `assets/ds.jpeg`(仓库自带,安装即见)
- 🛟 **无绝对路径依赖**:可选的 `imagePath` 覆盖配置;配置的图片被删除/不可读时,自动回退到内置 `ds.jpeg`,DSH 不受影响
- 📐 图片按视口宽度 50% 居中显示,固定不随滚动
- 💬 AI 输出消息卡片完全不透明(`--dsw-alias-bg-layer-1/2` alpha=1),文字清晰可读
- 🌗 亮 / 暗模式各有底色兜底(图片之外的区域不会露白)
- 📦 纯 JS、零依赖、无构建步骤;图片每次请求实时读取,替换图片无需重启

## 安装

前置:已装好 DSH(`dsh web` 能正常运行),Node.js ≥ 20。

### 方式一:git 通道(官方 CLI)

```sh
dsh plugin --profile web add github:jinzhengen964-cmyk/dsh-bg-skin
```

装完重启 `dsh web` 并硬刷新浏览器(Ctrl+Shift+R)。

> 如果 `dsh` 不在 PATH:`npx -y --package @deepseek-ai/dsh dsh plugin --profile web add github:jinzhengen964-cmyk/dsh-bg-skin`
>
> pnpm 若拦截构建脚本,在 `~/.dsh/profiles/web` 下运行 `pnpm approve-builds --all`(本插件无原生依赖,一般无需)。

### 方式二:源码 link(本地开发)

```text
1. git clone https://github.com/jinzhengen964-cmyk/dsh-bg-skin.git
2. ~/.dsh/profiles/web/package.json 的 dependencies 写 "dsh-bg-skin": "link:<克隆目录绝对路径>"
3. 把 "dsh-bg-skin" 追加到 ~/.dsh/profiles/web/package.json 的 dsh.profile.bundles
4. 在 ~/.dsh/profiles/web 执行 pnpm install
5. 重启 dsh web + 硬刷新
```

## 换自己的图(可选)

**默认不需要任何配置**——安装后看到的就是随插件分发的 `assets/ds.jpeg`。

想换成自己的图片时,在 web profile 的 `cordis.patch.yml`(`~/.dsh/profiles/web/cordis.patch.yml`)给 `bg-skin` 条目加 `config.imagePath`(绝对路径,或相对 `dsh web` 工作目录的相对路径):

```yaml
- id: bg-skin
  name: 'dsh-bg-skin'
  config:
    imagePath: 'C:/path/to/photo.jpg'
```

- 配置的图片**不存在/不可读** → 自动回退到内置 `assets/ds.jpeg`,插件与 DSH 正常运行
- 换图:直接覆盖该文件即可(每次请求实时读取,无需重启);改路径后重启 `dsh web` 生效

## 自定义代码

| 想改什么 | 改哪里 |
| --- | --- |
| 默认皮肤图片 | 替换 `assets/ds.jpeg`(或改 `lib/index.js` 的 `BUNDLED_IMAGE_PATH`) |
| 图片大小 / 位置 | `lib/client.js` 的 `background-size` / `background-position`(当前 `50% auto` 居中) |
| 面板透明度 / AI 输出 | `lib/client.js` 的 `theme.overrideTokens` 取值 |
| 最终兜底(内置图也失效时) | `lib/index.js` 的 `FALLBACK_SVG`(任意 SVG) |
| 路由路径 | `lib/index.js` 的 `ROUTE_PATH`(与 `lib/client.js` 的 `IMAGE_URL` 保持一致) |

改完重启 `dsh web` 生效(仅 client 改动时也可只硬刷新)。

## 卸载

```sh
dsh plugin --profile web remove dsh-bg-skin
```

或从 `~/.dsh/profiles/web/package.json` 删除依赖与 bundle 条目后 `pnpm install`。

## License

[MIT](./LICENSE)

Install

dsh plugin --profile web add github:jinzhengen964-cmyk/dsh-bg-skin

Profile: web

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