Adds a pin button to the DSH Desktop title bar that toggles always-on-top for the main window. Windows 10/11 only.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-always-on-top
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Suibianlilili/dsh-always-on-top
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
English | 中文
A pin button for the DSH Desktop title bar: click once to keep the window above every other window, click again to release it.
A small DSH plugin — one host route and one client script. No dependencies, no build step, ~30 KB unpacked.

Idle / pinned:

┌──────────────────────────────────────────────┐
│ App Edit 📌 ─ □ ✕ │
├──────────────────────────────────────────────┤
Features
- A pin button in the title bar, immediately left of the Windows minimize button
- Toggles always-on-top through the Win32
WS_EX_TOPMOSTwindow style - Turns blue while pinned; the tooltip reads "Always on top — click to unpin"
- Remembers the state and re-applies it on the next launch
- Hides itself when not running inside DSH Desktop on Windows
Install
The package is published on npm as dsh-always-on-top.
From npm (recommended)
# DSH CLI (web / tui profiles)
dsh plugin --profile web add dsh-always-on-top
# Or add it to the desktop profile directly
pnpm -C "$env:USERPROFILE\.dsh\profiles\desktop" add dsh-always-on-top
# Then add "dsh-always-on-top" to dsh.profile.bundles and restart the app
The
desktopprofile is owned by the Electron app, so the CLI refuses to manage it. Use the command above, or install from the app's plugin settings.
From GitHub
pnpm -C "$env:USERPROFILE\.dsh\profiles\desktop" add "github:Suibianlilili/dsh-always-on-top"
# Then add "dsh-always-on-top" to dsh.profile.bundles and restart the app
Manual
# 1. install the package into the profile
pnpm -C "$env:USERPROFILE\.dsh\profiles\desktop" add dsh-always-on-top
# 2. add "dsh-always-on-top" to package.json -> dsh.profile.bundles
# 3. restart the app
Usage
The pin sits at the right end of the title bar, left of the minimize button:
- grey: not pinned
- blue: always on top
Click to toggle. Tooltips follow the system language (English / Chinese).
How it works
DSH Desktop is an Electron app, so the window belongs to the Electron main process. The plugin runs in the DSH host process, which the main process spawns — therefore process.ppid is exactly the process that owns the window.
- Click → the client sends
POST /dsh-always-on-top/toggle - The host resolves the main window handle with
Get-Process -Id <ppid> - A short PowerShell script calls
user32!SetWindowPosto set or clearWS_EX_TOPMOST(HWND_TOPMOST/HWND_NOTOPMOST) - The host reads
GetWindowLong(GWL_EXSTYLE)back and only reports success when the bit actually changed
No Electron changes, no main-process injection, no undocumented APIs.
Compatibility
| Requirement | |
|---|---|
| OS | Windows 10 / 11 |
| Runtime | DSH Desktop (Electron) |
| DSH | 0.2.x (dsh.client injection), tested on 0.2.1-rc.2 |
The button stays hidden in dsh web (browser) and on other operating systems.
After a DSH upgrade
The button is positioned for the current title bar (42 px tall, ~138 px of window controls). If a future DSH release changes the title bar, adjust two numbers in the CSS in lib/client.js:
- button too far left/right or overlapping minimize →
right(currently146px) - button too high/low →
top(currently7px)
Limitations
- A toggle takes ~0.4–0.6 s (a PowerShell process compiles the P/Invoke declaration); the button shows a busy state
- State lives in
$DSH_HOME/dsh-always-on-top.json(default~/.dsh/) - Only the main window is affected; the welcome screen and update dialogs are not
Development
# the app must be running; pass the Electron main process PID
node scripts/toggle-test.mjs <pid>
License
MIT
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10735
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★ 10735
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★ 8661
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7538
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★ 5419
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1103
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.