跳过主要内容
M

dsh-icon-studio

microcapcap/dsh-icon-studio

用一张 PNG 替换 DeepSeek Harness 的应用图标——托盘、关于面板、桌面与开始菜单快捷方式、窗口、任务栏、资源管理器条目,以及可执行文件内的图标资源——换前备份原文件、换前校验打补丁后的可执行文件,并可一条命令恢复官方图标。

安装

dsh plugin --profile web add github:microcapcap/dsh-icon-studio

README

DSH Icon Studio

Give DeepSeek Harness your own icon. One PNG in, every surface out:

SurfaceSource it comes fromWhat the plugin does
Tray icon ("hidden bar")resources/tray.icowrites a fresh multi-size ICO
About panel iconresources/icon.pngwrites a 512 px PNG
Desktop / Start Menu shortcuts.lnk IconLocationretargets every shortcut that launches the exe
Window, taskbar, alt-tab, Explorer file iconicon resources inside DeepSeek Harness.exepatches RT_GROUP_ICON + RT_ICON with the Win32 resource API

Use it

Two ways in, one operation behind both.

Settings page. Open Settings → DSH 图标 (the section appears under the regular settings navigation). Drop or pick a PNG, the panel builds all sizes and shows the preview strip, then 应用 writes them. 还原默认 puts the originals back. Nothing is written until you press 应用.

Agent tool. The agent can only read state: dsh_icon_status reports what is applied right now. Changing or restoring icons is deliberately manual — the editor patches the executable and the shortcuts, so it happens only from the settings page after you press 应用.

The settings page talks to the Host half over loopback-only routes:

RoutePurpose
GET /api/dsh-icon-studio/statusinstallation, executable hash, signature, applied icon
POST /api/dsh-icon-studio/buildstore an uploaded PNG ({name, data} base64) and render the icon set
POST /api/dsh-icon-studio/applyapply a built icon ({slug}) to tray, shortcuts and executable
POST /api/dsh-icon-studio/restorerestore the recorded originals
GET /api/dsh-icon-studio/preview?slug=the preview contact sheet as PNG bytes

Every route is registered with auth: 'required', so a host with the token-provider admission authenticates it before the handler runs; on older hosts the handler still applies connection.requestRejection when that service exists. It then rejects non-loopback callers, cross-site sec-fetch-site, and a mismatched Origin, so a web page cannot drive it.

The tray icon and the window/taskbar icon are independent: changing one never changes the other.

What it guarantees

  • Backup first. The original tray.ico, icon.png, executable and shortcut IconLocation values are copied under %LOCALAPPDATA%\DSH-IconStudio\originals\ before anything is replaced.
  • Verify before swap. The patched executable is checked (icon group size and frame count) and started once in Electron's node mode; on failure the binary is left untouched.
  • Rename, never overwrite. Windows allows renaming but not overwriting the image of a running process, so the live executable is renamed aside and the patched one is copied in. A leftover that is still mapped is hidden, and the plugin deletes it the next time it starts.
  • Idempotent. When the live executable is already this plugin's build, the next patch is built from the recorded vendor binary instead of stacking a second icon group on top, so repeated applies produce the same bytes.
  • Transparent background. Existing transparency is kept; otherwise a white background is removed with a soft alpha ramp so anti-aliased edges and interior cut-outs stay clean.
  • Every size. 16, 24, 32, 48, 64, 128 px as 32-bit DIB and 256 px as PNG.

Requirements

  • Windows. The engine is scripts/iconstudio.py and uses only the Python standard library (ctypes, zlib), so any Python 3.8+ works — the DSH runtime Python is discovered automatically.
  • PNG input, 8-bit, non-interlaced.

Notes

  • Patching the executable changes its bytes; the Authenticode signature no longer matches afterwards. That is expected for a self-restyled binary, and 还原默认 in the settings page (or a DSH update) brings the signed original back.
  • A DSH update replaces the executable, so press 应用 again after one. The tray icon and shortcuts survive an update only if the updater leaves resources\ and the .lnk files alone; dsh_icon_status shows what is live.
  • Each apply keeps its source image as source.png next to the generated set, so an icon can be rebuilt or re-applied from the plugin's own folder.
  • Everything the plugin writes lives in %LOCALAPPDATA%\DSH-IconStudio\; delete that folder after 还原默认 to reclaim the backup space.

Tests

Run with the bundled Node runtime (electron --expose-internals --check works for syntax checks):

TestCovers
node tests/engine.mjsHost module shape + engine selftest (7 frames, all sizes)
node tests/routes.mjsThe five settings-page routes: fence, validation, status, build from an uploaded PNG, preview bytes
node tests/client.mjsThe client module wrapper: settings-section registration and a render pass with a stub React

License

MIT. See LICENSE.

相关插件