DSH Window Size: Save DSH client main window size and position in settings

Introduction

When using the DeepSeek Harness (DSH) desktop client, the system or window manager often needs to “remember” the main window’s dimensions and screen coordinates for the last session; however, when switching machines, clearing configurations, or when the client itself fails to persist these settings, you have to manually drag the window every time. The community plugin dsh-window-size (maintained by myxiyues) incorporates this into Client → Settings → Window Size: fill in the values and click save to apply. It automatically restores the state once every time the client is launched. Implementation-wise, it modifies the window via Win32 APIs within the host process, without scheduling tasks or starting external daemon processes.

What is this

dsh-window-size is a DSH client-side plugin (Category: Client). It only provides a “Window Size” section in the settings (settings.section slot); it does not add buttons or panels to the main interface, nor does it register tools or commands. Configurations are saved in the user directory. After a restart, the host applies the saved dimensions once after the window appears, and then stops polling.

Directory Page: SkillHub - dsh-window-size
Source Code & Documentation: GitHub - myxiyues/dsh-window-size (MIT, current package version 0.1.0)

Core Features

Below are the capabilities explicitly documented in the plugin’s materials.

Settings Page Save & Apply

  1. Open Client → Settings → Window Size.
  2. Fill in the Width and Height (the minimum limits are consistent with the client: minWidth 520, minHeight 600); X and Y can be left blank, which indicates that the position will be handled by the client’s default logic.
  3. Click Save and Apply: This immediately adjusts the main window and writes the configuration to disk.
  4. Subsequently, every time the client starts, the host will apply the saved dimensions once after the window appears, and then cease intervention.

To revert to the client’s default dimensions, use Clear Saved Data (this deletes the configuration file).

Window Identification & Safety Boundaries

  • It only processes visible windows whose titles contain DeepSeek Harness or belong to this process tree; it does not operate on other application windows.
  • If window control loading fails, it does not throw exceptions to the host; the settings page will display the failure reason, and the configuration can still be saved.

Implementation (Why it is not a “Daemon Script”)

  • No scheduled tasks, no resident polling, no external script processes. It binds user32.dll within the client host process via the bundled koffi (path shape: resources\app.asar.unpacked\dsh\node_modules\koffi) and calls functions like EnumWindows, GetWindowRect, SetWindowPos, ShowWindow, etc.
  • The host process is a child process of the client main process, sharing the same integrity level as the window, so SetWindowPos will not be blocked by UIPI.
  • The window is modified only at two moments: once for convergence after the client starts and when the user clicks save/apply in the settings page. When the client is not running, there are no processes, windows, or pop-ups on the plugin side.

Configuration & RPC

Location Description
~/.dsh/window-size.json Saved configuration fields: width, height, x, y, maximized, applyOnStart, savedAt
~/.dsh/window-size.log Result lines related to startup application/saving for troubleshooting (automatically truncated)
POST /api/window-size/dispatch RPC registered by the host (via connection.fetch.register)

The RPC message style is the same as dsh-novel-desk. For example, a client request:

// Client → Host
{ "type": "client-request", "method": "window-size/dispatch", "rpcId": "…", "payload": { "action": "config.save", "args": { "width": 2027, "height": 1074, "x": 231, "y": 163 } } }

Possible values for action include: state.get, config.save, config.apply, config.clear, window.read, windows.list.

Installation & Activation

The official README explains: The client bundles pnpm; the profile is located at ~/.dsh/profiles/desktop. It has been assembled via the dev_install_package of dsh-super-injector (creating a link dependency in the profile’s package.json and writing to dsh.profile.bundles). The package’s cordis.patch.yml contains only a single insert line to ensure proper assembly by the profile’s bundles after a restart.

# Client bundles pnpm; profile is at ~/.dsh/profiles/desktop
# Assembled via dsh-super-injector's dev_install_package (profile package.json link dependency + dsh.profile.bundles)

If you are using the injector to uninstall, you can execute dev_uninject_plugin in one step and match the package name dsh-window-size.

Typical Usage

Following the installation and setup entry points above, you can reproduce the flow described in the README for daily use:

  1. Start the DSH client and navigate to Settings → Window Size.
  2. Fill in the width and height as needed; fill in X and Y if you want to pin it to a specific monitor, otherwise leave them blank.
  3. Click Save and Apply and confirm that the window changes immediately.
  4. Fully exit and restart the client, and confirm that the dimensions (and saved position) are restored once after the window appears.

For troubleshooting, you can check the lines related to startup and saving in ~/.dsh/window-size.log.

Use Cases & Notes

Who it is for: Developers who use the DSH desktop client on fixed resolutions or multi-monitor layouts for extended periods and want the plugin to explicitly persist the width, height, and coordinates to disk, restoring them once at startup.

Permissions & Trust: Window operations are executed within the DSH client host process, running with the current DSH process permissions; please read the source code and the MIT license yourself before installation to ensure it complies with your security policy.

Platform: The implementation relies on Windows user32 and in-process koffi bindings; the materials are targeted at Win32 client scenarios. Behavior on other platforms is subject to the repository’s documentation.

Ecosystem Note: The DSH community plugin directory (such as SkillHub) is an independent site and has no official affiliation with DeepSeek or High-Flyer; the plugin integrates into the profile via a Cordis patch and belongs to the “everything is a plugin” ecosystem as a client extension, rather than a built-in feature.

Conclusion

dsh-window-size consolidates main window dimensions and position into the settings page and ~/.dsh/window-size.json, automatically restoring them once at startup without remaining resident in the background. For further details on parameters and RPC, please refer to the GitHub README.

  • Directory Page: https://www.skillhub.cn/plugins/myxiyues/dsh-window-size
  • GitHub: https://github.com/myxiyues/dsh-window-size
羽毛球分组比赛记分
小程序二维码

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

Xiaoye