dsh-mood-light: Display Screen Edge Ambient Light Based on DSH Session Status

Preface

The philosophy of DSH is “everything is a plugin.” dsh-mood-light is a client-side plugin for the DSH Web interface that displays an ambient light ring on the outermost layer of the screen based on the current session’s running status. It does not interfere with operations; it merely translates session states into colors and rhythms.

What This Is

dsh-mood-light displays light of different colors and rotation/flashing rhythms on the outermost layer of the DSH Web interface. The default effect is a soft glow, which can also be switched to a marquee or linear gradient.

The provided repository installation entry is lihang-lh/dsh-moon-light; the installation commands below are given based on this entry.

Core Features

  • Displays different light effects based on DSH session status: a flowing green light band with flashing while running; a pink light band when completed/idle; a yellow light band when there are pending items; turned off when there is no session/blank/disabled.
  • Default soft glow (diffused light), with optional marquee (rotating light band) and linear gradient (static).
  • Registers an “Ambient Light” page in the settings panel, where parameters can be adjusted visually and persisted to localStorage.
  • Adjustable enable toggle, light band width, opacity, effect style, light band style, marquee rotation speed, diffusion range, irregularity intensity, brightness flashing, and status gradient colors, with support for restoring defaults.
  • The light band is purely decorative and uses pointer-events: none, so it does not block any operations.
  • Automatically stops animations when prefers-reduced-motion is supported.
  • Supports local installation via link:, uninstallation, and overriding deployment-level defaults through profile patches.

Installation and Activation

First, use the given GitHub installation entry:

dsh plugin --profile web add "github:lihang-lh/dsh-moon-light"

After installation, restart dsh web and refresh the page to see the effect. The client-side plugin registry is assembled at startup, so a restart is required after installation.

During development, you can install from a local path:

dsh plugin --profile web add "link:/your-local-path/dsh-moon-light"

To uninstall:

dsh plugin --profile web remove dsh-moon-light

Settings and Persistence

Open the settings panel in DSH Web and navigate to the “Ambient Light” page. Parameters on the page can be adjusted visually and are saved to localStorage. The configuration priority is:

localStorage > plugin line config > built-in defaults

The namespace of third-party plugins is not exposed in the host settings wire whitelist, so user configuration is stored in localStorage.

Overriding Deployment-Level Defaults

Override deployment-level defaults via the config of id: mood-light in ~/.dsh/profiles/web/cordis.patch.yml. This can be written as a profile patch:

# ~/.dsh/profiles/web/cordis.patch.yml
- id: mood-light
  config:
    # Override deployment-level defaults here

This approach does not modify the plugin itself and is suitable for uniformly adjusting default values during deployment.

Local Development and Preview

Run a syntax check on the bundle:

node --check client.js

Run tests for state mapping, config merging, persistence, and soft glow rendering:

node scripts/test.cjs

Without installing the plugin, you can use a browser to open docs/preview.html to preview the effect.

Use Cases and Notes

Suitable for users who need to quickly perceive session status on the DSH Web interface: a flowing green light band with flashing during execution, a yellow light band when there are pending items, and a pink light band when completed/idle.

The plugin runs with the permissions of the current dsh process. Before installation, you should review the source code and license. The plugin is licensed under MIT.

Links

GitHub repository: https://github.com/lihang-lh/dsh-moon-light
Catalog page provided in the plugin clue: https://www.skillhub.cn/plugins/lihang-lh/dsh-moon-light

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

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

Xiaoye