dsh-tray-desktop: Low-Overhead Integration Suite for Linux Desktop

Preface

When running DeepSeek Harness (dsh web) on Linux, it is typically opened in a terminal or browser tab, lacking a desktop-level entry point and system tray integration. Frequent window switching, manual copying of login tokens, browser translation pop-ups, and external link redirect logic all interrupt the development and usage workflow.

What It Is

dsh-tray-desktop is a lightweight desktop integration suite for DeepSeek Harness, designed for the Linux / GNOME desktop environment and developed by maintainer lbg2002. Through system tray integration, single-instance windows, a streamlined Chrome container, and external link fallback to the main browser, it brings dsh web into the desktop workflow while maintaining 0% idle CPU/GPU consumption across the entire chain.

Core Features

System Tray Indicator

The tray icon is provided by bin/dsh-tray.py, mounted to the top bar via AyatanaAppIndicator3 (compatible with AppIndicator3), and generates a desktop autostart entry.

  • Refreshes only when the menu is opened, supplemented by a lightweight 15-second status check. Idle CPU usage is 0.0%, with no persistent frontend polling.
  • Supports one-click actions: “Open DeepSeek Harness,” “Start / Restart Background Service,” and “Stop Background Service.”

Single-Instance Window Locking and Wake-up

Window launch and wake-up are handled by bin/dsh-open.sh and deepseek-harness.desktop.

  • Uses flock concurrency locks, wmctrl, xdotool, and _NET_STARTUP_ID focus token passing. Whether triggered from the tray or the application launcher, clicking again will bring the already-open deepseek-harness main window to the foreground and activate it, preventing duplicate pop-ups.
  • Cold starts default to maximized across the desktop workspace, with triple guarantees via Preferences, --start-maximized, and _NET_WM_STATE_MAXIMIZED_{HORZ,VERT}, avoiding a half-screen initial window in XWayland HiDPI scenarios.
  • Automatically extracts the latest ?token= login URL from journalctl --user -u dsh.service, eliminating the need to manually copy tokens on cold start.

Streamlined Independent Application Container

The independent window uses minimal launch parameters and atomic configuration writes to suppress Chrome’s built-in translation and redundant background processes.

  • Disables the local language detection model (LanguageDetectionModel), spell check, casting scan (MediaRouter), OptimizationHints, Autofill, and Safe Browsing background polling.
  • Writes configuration atomically before launch and appends streamlined launch parameters, completely eliminating annoying Chrome web page translation pop-ups.

External link fallback is implemented by lib/index.js, lib/client.js, and bin/dsh-open-external.sh.

  • Embeds an approximately 12 KB event-driven Cordis plugin with zero setInterval and zero MutationObserver. Idle resource consumption is 0%.
  • Automatically injects <meta name="google" content="notranslate"> and translate="no".
  • When an external http(s) link is clicked or window.open is triggered within DeepSeek Harness, no additional isolated window is created. Instead, after safe validation, the link opens in the system default main browser (e.g., the daily-use Chrome main profile) and receives focus, fully inheriting the main browser’s login state and browsing history.
  • Compatible with both scenarios where the main browser is already running and cold start scenarios. Uses systemd-run --user --collect with exec to prevent child processes from being accidentally killed by cgroup on exit.

Systemd User-Level Background Daemon

The background daemon is managed by dsh.service.

  • Automatically detects the system node / dsh executable paths, compatible with nvm / fnm / pnpm / global installations.
  • Autostarts dsh web --no-open at boot, and automatically preserves or writes proxy environment variables per --proxy.

Installation and Enablement

Environment Dependencies (Ubuntu / Debian GNOME)

Before installation, ensure the required system base packages for window focus switching and system tray support are in place:

sudo apt update
sudo apt install -y wmctrl xdotool x11-utils python3-gi gir1.2-ayatanaappindicator3-0.1

If using the Ubuntu / GNOME top-bar tray, ensure AppIndicator support is enabled in the desktop (Ubuntu ships the Ubuntu AppIndicators extension by default).

One-Click Installation

git clone https://github.com/lbg2002/dsh-tray-desktop.git
cd dsh-tray-desktop
./install.sh

Common optional flags:

# Specify DSH profile (default: web) and configure service proxy
./install.sh --profile web --proxy http://127.0.0.1:7890

# Do not preserve/write proxy variables
./install.sh --no-proxy

# Only update files and plugin registration; do not restart dsh.service immediately
./install.sh --no-restart-service

After installation completes, the following are deployed:

  • ~/.local/bin/{dsh-open.sh,dsh-open-external.sh,dsh-tray.py}
  • ~/.local/share/icons/deepseek-harness.svg
  • ~/.local/share/applications/deepseek-harness.desktop
  • ~/.config/autostart/dsh-tray.desktop
  • ~/.config/systemd/user/dsh.service
  • Automatically registers dsh-tray-desktop into the bundles of the corresponding dsh profile

Install as a DSH Plugin Only

If you only need the web-side “disable translation + external link redirect to default browser” bridge plugin (invoked via fallback from lib/index.js to the built-in bin/dsh-open-external.sh), you can also install the pre-built release package directly:

dsh plugin --profile web add https://github.com/lbg2002/dsh-tray-desktop/releases/download/v0.1.1/dsh-tray-desktop-0.1.1.tgz

Typical Usage

Via the tray menu:

  1. Click the tray icon and select “Open DeepSeek Harness.”
  2. If the service is not running, select “Start / Restart Background Service.”
  3. Clicking the tray icon or the application launcher again will wake up and focus the already-open deepseek-harness main window.
  4. On cold start, the ?token= login URL is automatically extracted from journalctl --user -u dsh.service and navigated to.

Within the independent window:

  1. Clicking any external http(s) link or triggering window.open will open the URL in the system default main browser and bring it to focus.
  2. No additional isolated window is created; the main browser’s login state and browsing history are inherited.

Applicable Scenarios and Notes

Suitable for developers and users on Linux / GNOME desktop environments who want to integrate dsh web into their desktop workflow and reduce window switching and manual operations.

Before installation, it is recommended to review the source code and license (MIT). The plugin runs with the current dsh process permissions. Ensure all environment dependencies (wmctrl, xdotool, python3-gi, gir1.2-ayatanaappindicator3-0.1, etc.) are satisfied.

Closing

dsh-tray-desktop brings DeepSeek Harness into the desktop workflow through system tray integration, single-instance windows, a streamlined container, and external link fallback to the main browser, while maintaining low resource consumption. For more details and source code, visit:

  • Plugin directory page: https://www.skillhub.cn/plugins/lbg2002/dsh-tray-desktop
  • GitHub repository: https://github.com/lbg2002/dsh-tray-desktop
羽毛球分组比赛记分
小程序二维码

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

Xiaoye