Scan a QR code with WeChat, upload a photo from the phone, and use it as the DSH Web UI background.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:XinpengWei/dsh-wechat-bg
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
用手机给 DSH 换一张全屏背景:设置 → 背景图 → 手机微信扫一扫 → 从相册选一张照片 → 电脑上的 DSH 立即换上。
用法
- 确保手机和电脑连接同一个 Wi-Fi。
- 打开 DSH 的「设置」,在左侧导航里点「背景图」。
- 手机微信「扫一扫」,打开上传页。
- 选一张照片,点「设为 DSH 背景」。这一页会在 2 秒内自动刷新,背景就位。
照片在手机上会先压到长边 2560 px 的 JPEG 再上传,原图不会离开手机。上传后照片保存在这台电脑的 $DSH_HOME/wechat-bg/photos/,重启 DSH 后仍然生效。
传过的照片都会留在「照片库」里:点任意一张缩略图就换成那张,鼠标悬停缩略图右上角出现 ×,点一次进入待确认(变成红色 !),再点一次才真的删掉。移除背景 只是把当前这张撤下来、让页面恢复原样,图库里的照片仍然保留,随时可以再点回来。
这一页有两根滑杆,都按浏览器本地保存,下次打开还是上次的档位:
- 「背景浓度」控制整张照片透出的强度(默认 60%):0 完全不透明、照片一点都看不到;100 完全透明,看到的就是照片原样(连压暗的渐变也去掉)。默认档约等于 48% 白色遮罩,和旧版观感一致。
- 「侧栏浓度」只控制左侧导航栏(默认 60%):和主浓度同一条曲线,两端也一样——0 全实、100 全透;两根滑杆互不影响,各自记忆。
「显示方式」有两种:「铺满」按窗口比例裁掉多余部分(background-size: cover),竖图在宽窗口里只会露出中间一条;「完整」把整张照片放进窗口(background-size: contain),两侧留深色底,照片一点不裁。想改构图就用下面的「裁剪」,在完整原图上框选。
照片比例不合适时,点这一页的「裁剪」:取景框里显示手机上传的整张原图,先用鼠标滚轮(或触控板双指)缩放照片,再拖动白色取景框选择区域;也能用方向键微调(按住 Shift 步长更大),旁边的「− / +」按钮同样可以缩放,点「用框内区域」就把它设为新背景。「取景框」默认是「窗口比例」,框里看到的构图就是铺满后的构图;如果只想保留整张照片,把取景框切成「整张照片」,框会自动铺满整张图,保存后显示方式同时切到「完整」,照片不会被窗口再裁一刀。每次都从原图重新裁,所以反复调整不会越裁越糊;想放弃裁剪就点「用整张原图」。裁剪结果会覆盖原图(以新版本写入 $DSH_HOME/wechat-bg/),想反悔重新扫一次码上传即可。
实现
- Host 半区(
index.js):DSH 的 web 服务只监听127.0.0.1,手机连不上,所以插件在0.0.0.0上另起一个随机端口的小服务,只接受带随机 token 的/p/<token>路径。同时在 DSH 同源注册/api/dsh-wechat-bg/{state,image,source,select,delete,clear,crop,rotate};图库索引写在$DSH_HOME/wechat-bg/library.json(当前用哪张、每张的原图与裁剪版本),照片文件在photos/下,裁剪结果写成<id>.crop.jpg,原图始终不动。 - 浏览器半区(
client.js):shell.overlay里渲染一个全局<style>,把照片铺在html上(带!important,因为 DSH 在 darwin 下用html[data-platform=darwin]{background:transparent}把根元素背景清掉了,不加权会输),再把--dsw-alias-bg-base等表面 token 调成半透明,让会话区、侧边栏一起透出照片,形成磨砂效果;入口是settings.section里的一页(设置 → 背景图),不再占侧边栏底部和主界面。 - 二维码:服务端根据
qrcode-generator(MIT,已 vendored 到vendor/)的矩阵直接生成内联 SVG,不依赖任何 CDN。 - 不写 DOM、不碰
document.body、不使用 iframe,样式只用 DSH 主题 token。
注意
- macOS 首次运行时系统可能询问是否允许「DeepSeek Harness」接受传入连接,需要允许,否则手机打不开上传页。
- 如果电脑有多个网卡(VPN、虚拟机网桥),插件会优先选择
192.168.*/10.*的地址;选错了可以在面板里点「换一个二维码」重试。 - 手机页由插件自己提供,与 DSH 的登录态无关;token 每次刷新二维码都会更换。
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10290
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10290
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 7336
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7093
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5036
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
Devin-AXIS/deepseek-design#deepseek-idesign★ 1792
Visual design studio for websites, app prototypes, posters, cards, reports, and magazines, with templates, direct element editing, selection-aware AI draft handoff, and export.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.