dsh-open-exit-animation:DSH Entry and Exit Animation

Preface

After launch, DeepSeek Harness (DSH) typically jumps straight into the workspace and lacks a configurable “title sequence.” When quitting via the tray menu, the window may also be hidden in the background, making it feel like the app “vanished out of nowhere.” The community often resorts to swapping themes or hacking static resources, but few turn “launch once, truly exit once” into an adjustable, previewable plugin capability that doesn’t require bundling video files.

Below is the dsh-open-exit-animation plugin (SkillHub category: Fun & Dress-up), maintained by samsam560 in the samsam560/dog-kjdh GitHub repository. The plugin package name and npm name are both dsh-open-exit-animation, currently at version 0.3.1, licensed under MIT, and requires DSH >=0.1.5-rc.1 and Node >=20.

What Is This

In short: it adds opening animations and closing animations to DSH, rendered purely in code by default (CSS/SVG + custom-property particles), with zero video assets required. You can also use your own video or animated image locally; binaries are stored in the browser’s IndexedDB and are never uploaded or transmitted over the network.

  • Opening: automatically plays once after DSH launches and the page is ready (default style ~2.26s).
  • Closing (actual shutdown): when exiting from the tray menu (right-click → Exit / Quit), the desktop shell first brings the window to the foreground, then await globalThis.__dshExitAnimation(); after the exit animation finishes, the app truly quits (default ~1.42s).
  • Clicking the window’s X button: by default, no animation plays; the window simply hides to the tray. If you want the exit animation when clicking X, enable “Play on window close” in the settings (config key exitOnClose).

Directory page: https://www.skillhub.cn/plugins/samsam560/dog-kjdh. SkillHub is a community-run independent directory, with no official affiliation to DeepSeek or Hunyuan.

Five Built-in Styles

All styles can be switched and previewed instantly on the settings page:

Style id Name Description
whale Whale Light Sweep (default) Whale outline → light sweep → particle convergence → wordmark
pulse Minimal Pulse Solid whale + 3 expanding breathing rings (~1.9s / 1.2s)
stardust Stardust Convergence 54 particles converge toward the center to form text (~2.4s / 1.5s)
typewriter Typewriter Cursor + scan line types character by character (~2.1s / 1.1s)
rings Radar Rings Outlined whale + grid + radar sweep (~2.0s / 1.3s)

Beyond the styles, you can adjust: speed (0.5–3×), particle count (0–60), accent color (7 presets + custom color picker), and three text fields (wordmark / opening subtitle / closing subtitle, up to 48 characters each). Default text: word = DeepSeek Harness, subOpen = Starting up, subExit = Shutting down.

Bring Your Own Video or Animated Image

The window sandbox cannot directly use file:// as a <video src>, so when selecting a file, it is read as a Blob and stored in IndexedDB (database name dsh-open-exit-animation-media); at playback time, a same-origin blob: URL is used.

  1. After restarting DSH, go to Settings → Toggle Animation (bottom of the left sidebar, gear icon).
  2. In “Video assets (optional)”, click Select… for opening and/or closing (supports mp4 / webm / mov / mkv / gif / png, etc.), or Clear.
  3. Options include mute, max asset playback duration (0.8–15 seconds), and fit mode (cover full-bleed crop / contain show entire frame); a preview starts immediately after selection. Directions without a custom asset still use the code-drawn animation. If decoding fails, it falls back to the code-drawn animation with a console.warn—no black screen. The closing asset is capped at 7 seconds for the finale (desktop shell patch has an 8-second fallback).

Without restarting DSH, you can double-click preview.html in the repo root to load the same lib/client.js and preview in your browser.

Installation and Activation

The plugin runs with the current DSH process’s permissions; before installing, review the repo source code and the MIT license yourself.

# Search for "Toggle Animation" in the plugin marketplace and install; or manually:
dsh plugin add github:samsam560/dog-kjdh          # From GitHub (repo is the source, no build needed)
dsh plugin add link:/path/to/dsh-open-exit-animation   # Local source (for development)

After installation, fully quit and restart DSH so that the opening animation, the “Toggle Animation” settings panel, and custom media all take effect.

The closing animation (tray exit / quit application) depends on an optional desktop shell patch. Without patching, the opening animation, settings panel, and media features still work, but tray exit will not wait for the animation:

node tools/patch-asar.mjs --apply

On Windows, you can also double-click tools/apply-shell-patch.cmd. The patch performs a byte-equal-length replacement on lib/main.js inside app.asar; restore it with node tools/patch-asar.mjs --restore. DSH upgrades replace app.asar, so you must re-run --apply; use --check to view the current status. For custom install paths, use --asar <path> or the DSH_ASAR environment variable.

Settings Panel and Acceptance Testing

After restarting, follow the README for acceptance testing:

  1. Opening: upon entering the interface, the full-screen animation plays and fades out without blocking subsequent operations.
  2. Click X: by default, it goes straight to the tray without playing; enable “Play on window close” if desired.
  3. Tray exit: after confirmation, the window appears first, and the app quits only after the exit animation finishes.
  4. Settings: change style / speed / accent / text, and click “Preview Opening” / “Preview Closing”.
  5. Console: __dshAnim.open() / __dshAnim.exit(); keyboard shortcuts Ctrl+Alt+O / Ctrl+Alt+X.
  6. Custom media: select a file, preview it, restart, and check the opening animation; tray-exit to check the closing animation.

Configuration is persisted in the page’s localStorage under the key dsh-open-exit-animation:config; main switches include open, exit, exitOnClose, speed, style, particleCount, accent, and media-related keys such as mediaOpen / mediaExit (see the configuration table in the repo README for details).

Programming Interface (Excerpts)

The page-side bundle exposes __dshAnim, __dsaMedia, __dsaPanel, etc., for example:

__dshAnim.get()
__dshAnim.set({ style: "typewriter", speed: 1.4 })
__dshAnim.open() / __dshAnim.exit()
__dshAnim.version   // "0.3.1"

globalThis.__dshExitAnimation()   // awaited by the desktop shell on tray exit
globalThis.__dshCloseAnimation()  // called when clicking X; resolves immediately to false when exitOnClose is false

Use Cases and Notes

  • For: users who want DSH to have unified opening/farewell animations without maintaining video assets, and users who want personalized mp4/gif files stored only locally.
  • Notes: closing and X-button behavior involve the desktop shell patch; after upgrading DSH, check the patch status. When uninstalling, first run patch-asar.mjs --restore, then remove the dependency and bundle entries from the profile’s package.json, delete the junction, and finally restart DSH (see the README’s “Uninstall” section for steps).
  • Security: the plugin is categorized as “Fun & Dress-up” in the community directory; any DSH plugin should only be installed from trusted sources, and injected code such as lib/client.js should be reviewed.

Conclusion

dsh-open-exit-animation turns DSH’s launch and true shutdown into configurable animations: five pure-code styles work out of the box, advanced users can swap in local videos and fine-tune speed and text, and the closing animation requires an optional shell patch to integrate with tray exit. See the GitHub README for details and screenshots; installation is also accessible from the SkillHub directory page.

  • Directory page: https://www.skillhub.cn/plugins/samsam560/dog-kjdh
  • GitHub: https://github.com/samsam560/dog-kjdh
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye