SanYe-SanJiu/dsh-power-switch ↗★ 0
dsh-power-switch
Windows-only DSH plugin: one-click shutdown from the sidebar, plus an app-window / normal-tab launch switch that also fixes the desktop shortcut. 仅限Windows用户,适合需要快速关闭DSH或调整窗口启动模式的任务。
Install
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:SanYe-SanJiu/dsh-power-switchREADME
Read the full README ↗Configuration
The card's configuration page, or the loader row's config::
| Key | Default | Meaning |
|---|---|---|
launchMode | tab | Window for the next launch: tab or app |
delayMs | 1000 | Milliseconds to wait after answering before the exit begins. The answer itself needs 1200 ms to reach the browser, so that is the floor: 0 means "as soon as the answer is out", and anything below 1200 waits 1200 |
exitCode | 0 | The status the DSH process ends with, for whatever started it — a shell ($LASTEXITCODE), a service manager, a script. 0 is success, so a non-zero value is for a wrapper that wants to tell "the person closed DSH" apart from a crash |
hard | false | Skip the graceful path and end the process at once |
launchMode is switched from the card. The other three are edited from the card's own Advanced settings block, which writes them to settings.json in the state directory. That block exists because it is the only UI for those three on a DSH that generates settings forms (0.1.7) — a plugin without a declared schema gets no generated form, so without it they would be editable only by hand-editing the profile patch. On a host that still has the registered-namespace settings API, the same save is written to the settings document as well, so the two surfaces cannot disagree; the recorded value is the one that governs, and deleting settings.json hands the decision back to the loader row's config: and the settings document.
The card sends no delay of its own: delayMs governs every exit, the card's buttons included. (It used to send 700 ms "so the interface reacts sooner" — a number that could not matter, being below the 1200 ms the answer needs, and that silently outranked the setting.) A caller that wants a one-off delay can still put delayMs in the shutdown request body, which outranks the setting for that request only. With hard, the process ends after that same wait instead of after the watchdog.
Environment variables:
| Variable | Meaning |
|---|---|
DSH_POWER_SWITCH_NO_WINDOW=1 | Do not open a window for this launch |
DSH_POWER_SWITCH_WINDOW_HANDLED=1 | Another process is opening this launch's window; the launcher and the supervisor set it, and the plugin then opens no second window |
DSH_POWER_SWITCH_CLI | The dsh CLI entry, for a machine with no recorded launch command |
DSH_POWER_SWITCH_PORT | Port to probe (default 3080) |
DSH_POWER_SWITCH_LAUNCH_MODE, _DELAY, _HOST_LOG, _HANDSHAKE | Internal interface between the helper and the supervisor; no configuration needed |