Introduction¶
In the DSH plugin ecosystem, many extensions supplement service startup, configuration pages, and client capabilities. dsh-launcher-lifetime is a specific plugin designed to work with the dsh-launcher shell to control the lifecycle of the dsh (node) service.
If you start the dsh service using dsh-launcher, you might not want the service to continue running in the background after closing the window; however, if you prioritize quick availability upon reopening, you want the service to stay resident. This plugin leaves this choice to the user, offering three persistence modes: Persistent, Tray Persistent, and Follow Window.
What is this¶
dsh-launcher-lifetime is a DSH plugin used to control the lifecycle of the dsh (node) service in conjunction with the dsh-launcher shell. It is published by Ruler4396 under the MIT license.
It solves the core issue of what should happen to the dsh service when the window is closed or exited from the tray: should it continue running, minimize to the tray to stay resident, or stop directly?
Core Features¶
The plugin provides the following verified capabilities:
- Provides three persistence modes:
Follow Window,Persistent, andTray Persistent. - Provides a “Node Service Lifetime” configuration entry in the DSH settings page with vertical radio buttons that take effect immediately.
- Supports setting
serviceLifetimevia the DSHcordisconfiguration. - Writes to
DSH_HOME\dsh-launcher\settings.jsonwithout loading third-party runtime packages. - Only stops services launched by the
dsh-launchershell itself; services hosted externally or started manually are unaffected. - Writes settings via HTTP routes
GET/POST /dsh-launcher-lifetime/settings.
Installation and Usage¶
The installation command is as follows:
dsh plugin --profile web add dsh-launcher-lifetime
This plugin requires the dsh-launcher shell to be used. It is recommended to check the source code and license before installing; the plugin runs as a DSH plugin and accesses local files with the current DSH process permissions.
Typical Usage¶
Switching Persistence Mode in the DSH Settings Page¶
This is the most direct usage:
- Open the DSH settings page.
- Enter “Node Service Lifetime”.
- Select one of the modes; vertical radio buttons, takes effect immediately.
After changing, the next time the window is closed or exited from the tray, the dsh-launcher shell will execute according to the selected mode.
Setting via cordis Configuration¶
If you want to control this via configuration files, add the following to the profile’s cordis.patch.yml:
- id: dsh-launcher-lifetime
config:
serviceLifetime: 1
The value of serviceLifetime is:
0: Persistent (default value).1: Tray Persistent.2: Follow Window.
The cordis configuration requires a restart of dsh to take effect.
Sidebar Icon Customization (Optional)¶
Sidebar icons in the settings page can be customized locally, but this requires modifying the global dsh package. Since dsh upgrades may require re-applying changes, it is recommended to modify this only when necessary.
Applicable Scenarios and Notes¶
This plugin is suitable for the following usage patterns:
- You are using the
dsh-launchershell to start the dsh service. - You want to stop the dsh service when closing the window to free memory.
- You want the window to minimize to the tray, but specifically stop the service when exiting.
- You want the service to stay resident to reduce the wait time for restarting.
Pay attention to the following points when using:
- This plugin only affects services launched by the
dsh-launchershell itself; services hosted externally or started manually are unaffected. - Changes in the settings page take effect immediately; the
cordisconfiguration requires a restart of dsh. package.jsondeclares a Node version requirement of>=22.19.0.- The community directory is an independent site with no official affiliation to DeepSeek / Fangfang; do not interpret it as an official app store.
- You should check the source code, dependencies, and license before installing.
Related Links¶
Directory page:
https://www.skillhub.cn/plugins/Ruler4396/dsh-launcher-lifetime
GitHub:
https://github.com/Ruler4396/dsh-launcher-lifetime