Merged plugin: wallpaper customization (original-resolution uploads, crop editor, per-area opacity, MP4/WebM dynamic wallpapers) + Steam Workshop wallpaper extraction (parses scene.pkg/.tex via a bundled Python script, preview/download) + DeepSeek balance & usage widget + OpenCode Go plan usage (rolling/weekly/monthly percents in a top header pill; expand for progress bars & reset countdowns). API keys are read from DSH's credential store by the host — never stored in source or the browser.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:AppliedYuu/dsh-WallpaperAndCost
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.
A merged DSH web plugin combining wallpaper customization and the DeepSeek balance & usage widget.
Features
🎨 Wallpaper (壁纸)
- 8 built-in curated gradients (暮色 / 深渊 / 晨曦 / 森林 / 星夜 / 暖阳 / 青空 / 石墨)
- Upload your own images at full original resolution (no compression), stored in IndexedDB
- 动态壁纸:上传 MP4/WebM 视频,自动静音循环播放(铺底
<video>元素,object-fit: cover) - Crop editor: drag to pan + zoom (100%–250%) with a live viewport-proportional preview
- Independent absolute opacity sliders (0–100%) for the left sidebar, the conversation column and the right sidebar — the right-sidebar slider now drives both the dsh-better-sidebar panel and DSH's official right sidebar (dsh-client-ui-sidebar-right, detected via
[data-sidebar-right-panel]); the slider auto-appears whenever either sidebar is present - Wallpaper choice persists across restarts (localStorage + IndexedDB)
- 创意工坊壁纸提取(服务器目录):输入 Wallpaper Engine 创意工坊条目文件夹的绝对路径(
…steamapps\workshop\content\431960\<id>),由内置的scripts/extract_scene_pkg.py解析scene.pkg/.tex(含 LZ4 解压、DXT/RGBA→PNG、内嵌 MP4),提取最佳壁纸供预览与下载。需要运行 DSH 的机器装有 Python 3(脚本为纯 Python,Pillow 可选)。- 桌面端支持「选择文件夹…」:DSH Desktop(Windows)上可直接用系统原生文件夹选择器选取条目文件夹,自动填入绝对路径,避免手输/粘贴路径出错而报"文件夹不存在"。
- 路径自动规整 + 明确报错:路径会先去空白、剥成对引号、展开
~,并校验是否为绝对路径;读取失败会区分「文件夹不存在」「没有权限读取该文件夹(含 Windows 受控文件夹访问拦截)」「路径不是文件夹」,不再把权限问题笼统报成"文件夹不存在"。
🔍 Wallpaper Engine 创意工坊提取脚本
- 仓库自带独立脚本
scripts/extract_scene_pkg.py,可单独命令行使用:python scripts/extract_scene_pkg.py --folder <创意工坊条目文件夹> --out <输出目录> python scripts/extract_scene_pkg.py <scene.pkg> # 或直接解析单个 pkg python scripts/extract_scene_pkg.py <scene.pkg> --list # 只列出包内文件 - 支持容器:PKGV(scene.pkg)、TEXV0005/TEXI0001/TEXB000x(.tex)。内容类型:内嵌 JPEG/MP4、DXT1/3/5→.dds(有 Pillow 转 .png)、RGBA8888/R8 裸像素→.png、其余文件原样导出。
- 浏览器端另有无需 Python 的「从 Wallpaper 导入」入口(File System Access API 纯 JS 解包),两者互补。
💰 Balance & usage (余额与用量)
- Balance button in the conversation header: balance, today's consumption, this session's token usage & estimated cost
- Prices come from
pricing.json(data, not code): regex model ids, an optional peak/off-peak split, CNY per million tokens — see Model pricing - Per-model and per-window (peak/off-peak) breakdown in the popover
- The per-session ledger is durable: a host restart no longer zeroes the token meter. It is written to
$DSH_HOME/storages/dsh-wallpaper-cost-sessions.jsonand dropped only once that conversation is archived/deleted - Platform consumption (
DEEPSEEK_PLATFORM_TOKEN) is read from DSH's credential store by the host (ctx.credentials.resolve), the same wayDEEPSEEK_API_KEYandOPENCODE_GO_API_KEYare — no in-widget token capture - The DeepSeek API key never leaves the host (host-side routes only)
🏷 Model pricing (pricing.json)
The price table is one JSON file at the package root — editing it needs no code change and no rebuild; the host reloads it as soon as its mtime changes, and history is re-priced on the next replay.
{
"peakWindows": [{ "startHour": 9, "endHour": 12 }, { "startHour": 14, "endHour": 18 }],
"models": [
{
"match": "deepseek.*flash", // regex, matched against the bare model id
"flags": "i",
"label": "deepseek flash 系列",
"peak": true, // true = peak + offPeak (6 numbers); false = one flat group (3 numbers)
"price": {
"peak": { "cacheHit": 0.04, "cacheMiss": 2.0, "output": 8.0 },
"offPeak": { "cacheHit": 0.02, "cacheMiss": 1.0, "output": 4.0 }
}
}
]
}
- Regex ids: a vendor prefix (
deepseek-official/deepseek-v4-flash) is stripped before matching, sodeepseek.*flashcoversdeepseek-flash,deepseek-v4-flashanddeepseek-v4-flash-vision-expin one rule. Rules are tried in file order; the first match wins. peak: false— a vendor that does not split peak/off-peak gets one group of three numbers (cacheHit缓存命中,cacheMiss缓存未命中,output输出); the peak window is ignored for it.peak: true— six numbers:price.peak+price.offPeak, chosen by the message's Beijing hour.- Units are CNY per million tokens. The window logic itself (hours from
peakWindows, weekends always off-peak) stays in code because it is billing semantics, not price data. - A model absent from the table is counted as tokens only (
unpriced) instead of being priced with a guess; a missing/broken file falls back to a built-in flash table so costs never silently drop to zero.
🟢 OpenCode Go 用量 (rolling / weekly / monthly)
- 会话头部新增一个
Go按钮(与余额按钮并列于顶端):默认只显示滚动 / 周 / 月三个用量的百分比 - 点开后用进度条展示每个窗口用量,并显示各自的重置时间,以及上次刷新时间与实际使用的密钥名
- 刷新时机跟随两条 Go 路由的请求:
opencodego(自建供应商)与opencode-go(DSH 官方供应商)任一发出请求(会话事件里的assistant/message或request/header带provider),宿主就把用量版本号 +1,前端下次轮询才去上游拉一次;没有请求时前端每 5 秒问的只是本地宿主,宿主直接回缓存(不一定打上游)。点开面板会强刷一次(?force=1) - 快照缓存 5 分钟保质、4 秒内合并连发的刷新;上游临时取不到时继续显示上次结果并给出提醒,不会把面板清空
- 数据来自 OpenCode Go 官方用量接口
GET https://opencode.ai/zen/go/v1/usage(Bearer 鉴权),由 host 端代理,key 通过ctx.credentials.resolve按OPENCODEGO_API_KEY→OPENCODE_GO_API_KEY顺序解析(前者 401/403 时自动退回后者),从不入源码/浏览器 - 该接口为社区发现的非官方文档化接口,响应结构可能随 OpenCode 变动;窗口解析做了兼容(
usage.前缀或裸窗口、resetsAt或resetsInSeconds)
Install
dsh plugin --profile web add dsh-WallpaperAndCost
or from GitHub:
dsh plugin --profile web add github:<owner>/dsh-WallpaperAndCost
Restart DSH afterwards.
Requirements
- DSH web profile
DEEPSEEK_API_KEYcredential (设置 → 模型) for the balance feature- Optional
DEEPSEEK_PLATFORM_TOKEN(set in 设置 → 模型) for exact platform consumption figures OPENCODEGO_API_KEY(自建opencodego供应商)或OPENCODE_GO_API_KEY(官方opencode-go供应商)之一,用于 Go 用量面板
Structure
lib/index.js— host half: balance/cost API routes (/api/deepseek-balance,/api/deepseek-session-cost) + workshop extraction routes (/api/wallpaper-workshop/extract,/api/wallpaper-workshop/file) + OpenCode Go usage route (/api/opencode-go-usage, 支持?force=1;刷新由opencodego/opencode-go的会话请求驱动)lib/client.js— browser half: wallpaper + balance widget + OpenCode usage widget + workshop extraction UI (no build step required)pricing.json— 模型计价表(正则 id、峰谷开关、CNY/百万 tokens),唯一价格数据源,改完热生效scripts/extract_scene_pkg.py— standalone Wallpaper Engine.pkg/.texextraction engine (called by the host route; also usable as a CLI)cordis.patch.yml— bundle patch mounting the plugin row
Runtime files ($DSH_HOME/storages/)
| File | Purpose |
|---|---|
deepseek-balance-widget-day.json |
当日计量起点(余额差估算今日消费) |
dsh-wallpaper-cost-sessions.json |
分会话 token/费用账本:重启不清零,对话被归档/删除后由定时清理移除 |
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10461
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★ 10461
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★ 7811
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7275
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★ 5195
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1008
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.