DSH-macOS-Settings-Shortcut: Open DSH Desktop Settings with Cmd+,

Preface

The DSH Desktop web shell includes a settings dialog, but it lacks a keyboard shortcut consistent with macOS system conventions: many macOS applications use Cmd+, to open preferences, whereas the default shell does not map this gesture to the existing UI. Relying on the account menu or settings button every time adds an extra step when frequently adjusting configurations or debugging agent workflows.

The following is an introduction to the community-maintained profile-layer plugin dsh-macos-settings-shortcut (maintained by Qulierm). It does not modify files within the signed application bundle; instead, it injects a segment of browser-side logic into the desktop profile, enabling Cmd+, to open the settings entry point already rendered by the shell.

What is this

dsh-macos-settings-shortcut is a small bundle designed for the DSH Desktop desktop profile (Bundle ID: dsh-macos-settings-shortcut), targeting the directory $DSH_HOME/profiles/desktop (default ~/.dsh/profiles/desktop).

The plugin is published on the documentation page SkillHub Catalog and the GitHub Repository. SkillHub is a community plugin directory and has no official affiliation with DeepSeek or High-Flyer. The current package version is 0.1.0, and the license is MIT.

Core Features

Shortcut Behavior

On macOS, the plugin registers a capture-phase keydown listener on the document, recognizing only one specific combination:

  • metaKey is pressed, while ctrl / alt / shift are all unpressed;
  • The key corresponds to event.key === "," or event.code === "Comma" (layout-independent);
  • Key repeats and IME composition inputs are ignored.

Upon successful recognition, the plugin calls preventDefault() and stopPropagation() on the event to prevent other Cmd+, handlers in the browser or editor from responding simultaneously.

How to Open Settings (Two Shell Variants)

The plugin does not patch the shell source code; it only reads the current DOM:

  1. DSH Desktop 2.0.14 and newer (Account Menu): The shell places an account button in the settings.launcher slot, where the settings item is the first row of that menu. The plugin first snapshots mounted menus, clicks the collapsed launcher, and then clicks the first row of the newly appearing and visible menu (supporting React sync or async mounting, using a short-duration MutationObserver with a 1000 ms limit if necessary).
  2. Older Shells (Dialog Button): If the launcher falls back to a built-in dialog button, the plugin clicks it directly. However, it is considered valid only if the button contains the settings.trigger slot anchor (to avoid mistakenly clicking controls like context metering or usage statistics that also possess aria-haspopup="dialog").

Security & Boundaries

Several behaviors highlighted in the documentation are worth knowing:

  • If the settings dialog is already open (identified by [role="dialog"][aria-modal="true"] containing settings.header), Cmd+, only consumes the gesture and does not close the dialog; the launcher / trigger will also not be clicked to close it if aria-expanded is not "false".
  • The account menu path will not click (fail closed) if conditions such as “exactly one visible new menu appears,” “launcher remains expanded,” or “the first row is a normal, available, visible, non-submenu row” are not met.
  • The browser side has no runtime dependencies and does not read button text, React internals, Electron APIs, or application files; there are no network requests, file system access, or additional permission declarations.

Integration Method (Profile / Cordis)

Component Purpose
cordis.patch.yml Inserts a line into the profile’s Cordis tree (id/name: dsh-macos-settings-shortcut)
lib/index.js Cordis host-side placeholder plugin to keep that line active
lib/client.js Browser bundle, registered via window.__ModuleLoader__.load
package.json → dsh.bundle.patch Instructs the DSH application bundle layer to patch
dsh.client.platform: "web" Marks it as a Web client package, scanned and injected into the page by @deepseek-ai/dsh-client-modules

Environment & Compatibility

Item Description
OS macOS only; the plugin is ineffective on other platforms
DSH Desktop Supports the account menu shell (2.0.14+) and the older dialog trigger shell; dsh.compatibility.dshReleases in package.json currently only records 0.1.5-rc.2 as compatible. The 2.0.14 account menu path is verified by the test suite against installed client artifacts (see the repo README Release status)
Node.js ≥ 20 (required for building, testing, and profile installation scripts; not for runtime)
Package Manager pnpm is used for build and installation flows (packageManager: pnpm@11.8.0)
Runtime Dependencies None; the browser bundle is self-contained

Installation & Activation

Prerequisites: DSH Desktop is installed, Node ≥ 20 and pnpm are available locally, and the DSH home directory ($DSH_HOME or default ~/.dsh) is known. The installation script assumes you are executing it from the plugin repository root directory (checkout in the README refers to having a local copy of the repository).

First, perform a dry-run to confirm what will be written:

node scripts/install.mjs --dry-run --profile desktop

After confirming everything is correct, install to the desktop profile:

node scripts/install.mjs --profile desktop

Common options (excerpted from README):

Parameter Meaning
--profile <name> The profile to register the bundle with, default desktop
--dsh-home <path> DSH home directory, default $DSH_HOME or ~/.dsh, must be an absolute path
--dry-run Only prints planned changes, does not write to disk
--pnpm <path> Specifies the pnpm executable, defaults to pnpm on PATH

The repository also provides pnpm run build and pnpm test to generate lib/ from src/ and run tests; the tests do not modify your local live DSH installation.

Typical Usage

After installation and desktop profile loading are complete, open the DSH Desktop Web client on macOS:

  1. Focus the application window (ensure the shortcut lands on the shell page, not other native controls).
  2. Press Cmd+,.
  3. If settings are not open, the existing settings dialog should pop up, or the settings entry should be opened via the account menu; if settings are already open, the shortcut is consumed and the interface remains unchanged.

No additional configuration files or CLI are needed; the behavior is entirely determined by the client bundle in the profile and the current shell DOM structure.

Use Cases & Notes

Who it is for: Developers who use DSH Desktop on macOS long-term, wish for Cmd+, to open settings consistent with macOS application habits, and accept extending via the profile layer rather than modifying the application bundle.

Permissions & Security: The plugin runs with the permissions of the current DSH process and browser page; the host side is a no-op Cordis line, and the browser side only performs DOM queries and clicks. The documentation declares no host capabilities. Before installation, it is recommended to read the source code and LICENSE and use --dry-run to clearly see the profile paths the install script will modify.

Limitations: No effect on non-macOS systems; changes in shell markup may cause selectors to fail (the repository includes comparative tests that read-only inspect installed client bundles under /Applications, which will skip if DSH Desktop is not present). dsh.compatibility metadata may not be synchronized with the latest shell release rhythm; if the shortcut does not respond after upgrading DSH Desktop, check the README compatibility table and issue tracker.

Conclusion

dsh-macos-settings-shortcut bridges the gap between the macOS Cmd+, convention and DSH Desktop’s existing settings UI via profile injection, without modifying the signed application or requesting additional permissions. For details, build, and test instructions, see the GitHub README; to browse the entry on SkillHub, see the Catalog Page.

羽毛球分组比赛记分
小程序二维码

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

Xiaoye