dsh-screensaver 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-ASSETS.md +6 -6
- package/README.md +92 -28
- package/README.zh-CN.md +75 -24
- package/app/main.js +11 -9
- package/app/saver.js +63 -16
- package/app/screens.js +36 -0
- package/app/shell/index.html +2 -0
- package/app/shell/main.js +42 -11
- package/app/themes.js +5 -3
- package/bin/dsh-screensaver.js +14 -6
- package/cordis.patch.yml +3 -2
- package/docs/themes.md +22 -3
- package/lib/cli.js +182 -0
- package/lib/command.js +8 -5
- package/lib/index.js +4 -3
- package/lib/settings.js +99 -0
- package/llms.txt +11 -8
- package/native/unlock/main.swift +41 -10
- package/package.json +13 -3
- package/themes/magic-tower/LICENSE +9 -0
- package/themes/magic-tower/README.md +60 -0
- package/themes/magic-tower/THIRD_PARTY_NOTICES.md +20 -0
- package/themes/magic-tower/index.html +5023 -0
- package/themes/magic-tower/saver.json +1 -0
- package/themes/subspace/LICENSE +9 -0
- package/themes/subspace/README.md +52 -0
- package/themes/subspace/THIRD_PARTY_NOTICES.md +15 -0
- package/themes/subspace/index.html +4512 -0
- package/themes/subspace/saver.json +1 -0
package/LICENSE-ASSETS.md
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
| Path | What | License |
|
|
9
9
|
| --- | --- | --- |
|
|
10
|
-
| `themes/**` (every theme: `basic` Clock, `subspace` Subspace Jump, and future themes in this repo) | The theme's visual design and everything that draws it: HTML, CSS, scenes, shaders, animation, generated `index.html` | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) |
|
|
11
|
-
| `docs/images/**`, `assets/icon.png` | Screenshots, plugin icon | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) |
|
|
10
|
+
| `themes/**` (every theme: `basic` Clock, `subspace` Subspace Jump, `magic-tower` Arcane Study, and future themes in this repo) | The theme's visual design and everything that draws it: HTML, CSS, scenes, shaders, animation, generated `index.html` | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) |
|
|
11
|
+
| `docs/images/**`, `assets/icon.png` | Screenshots, demo GIFs, plugin icon | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) |
|
|
12
12
|
| Everything else: `app/`, `lib/`, `bin/`, `native/`, `test/`, docs text | The screen saver engine, dsh plugin, Touch ID helper, session detection, theme API | [MIT](LICENSE) |
|
|
13
13
|
|
|
14
14
|
| 路径 | 内容 | 授权 |
|
|
15
15
|
| --- | --- | --- |
|
|
16
|
-
| `themes
|
|
17
|
-
| `docs/images/**`、`assets/icon.png` |
|
|
16
|
+
| `themes/**`(本仓库所有主题:基础版「时钟」、「亚空间跃迁」、「魔法书斋」,以及以后加进来的) | 主题的视觉设计和画出它的一切:HTML、CSS、场景、着色器、动画、打包出来的 `index.html` | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-hans) |
|
|
17
|
+
| `docs/images/**`、`assets/icon.png` | 截图、演示动图、插件图标 | [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-hans) |
|
|
18
18
|
| 其余:`app/`、`lib/`、`bin/`、`native/`、`test/`、文档文字 | 屏保引擎、dsh 插件、Touch ID 小程序、会话识别、主题接口 | [MIT](LICENSE) |
|
|
19
19
|
|
|
20
20
|
## You may / 你可以
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
|
|
34
34
|
These keep their own terms and are not covered by the CC license above:
|
|
35
35
|
|
|
36
|
-
- **three.js** (bundled in `themes/subspace/index.html`): MIT, © three.js authors.
|
|
37
|
-
- **DeepSeek Harness whale** (`themes/subspace/assets/dsh.svg`): MIT, © 2026 DeepSeek (`@deepseek-ai/dsh-web-frontend`).
|
|
36
|
+
- **three.js** (bundled in `themes/subspace/index.html` and `themes/magic-tower/index.html`): MIT, © three.js authors.
|
|
37
|
+
- **DeepSeek Harness whale** (`themes/subspace/assets/dsh.svg`, `themes/magic-tower/assets/dsh.svg`): MIT, © 2026 DeepSeek (`@deepseek-ai/dsh-web-frontend`).
|
|
38
38
|
- **Claude mark** (`assets/claude.png`) and **Codex app icon** (`assets/codex.png`): trademarks of Anthropic and OpenAI.
|
|
39
39
|
The DeepSeek whale is also a DeepSeek trademark. They are used only to identify which product a session belongs to.
|
|
40
40
|
This project is not affiliated with or endorsed by these companies.
|
package/README.md
CHANGED
|
@@ -9,13 +9,19 @@ running, waiting for your approval, finished or stopped.
|
|
|
9
9
|
It is a [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) plugin, and it also runs on its own
|
|
10
10
|
with `npx`.
|
|
11
11
|
|
|
12
|
-
[中文说明](README.zh-CN.md) · [llms.txt (summary for AI assistants)](llms.txt) · [Theme API](docs/themes.md) · [Visual assets license](LICENSE-ASSETS.md)
|
|
12
|
+
[中文说明](README.zh-CN.md) · [llms.txt (summary for AI assistants)](llms.txt) · [Theme API](docs/themes.md) · [Theme skill](skills/dsh-screensaver-theme/SKILL.md) · [Visual assets license](LICENSE-ASSETS.md)
|
|
13
13
|
|
|
14
14
|

|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
Subspace Jump and Arcane Study each have an idle scene for when nothing is running and a running scene for when your
|
|
17
|
+
agents are working, and switch between them by themselves. Each clip below is 3 s of one scene, the transition, then
|
|
18
|
+
5 s of the other. Clock is a macOS-style lock screen with no scenes: only the time moves.
|
|
19
|
+
|
|
20
|
+
| | Agents start: idle → running | Agents finish: running → idle |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| **Subspace Jump**<br>`subspace` |  |  |
|
|
23
|
+
| **Arcane Study**<br>`magic-tower` |  |  |
|
|
24
|
+
| **Clock**<br>`basic` |  |  |
|
|
19
25
|
|
|
20
26
|
## Why not the macOS screen saver, the lock screen, or a wallpaper?
|
|
21
27
|
|
|
@@ -29,7 +35,7 @@ keep working and you only want the screen covered.
|
|
|
29
35
|
| Computer-use agents and extension-driven browsers keep running | No, they stop ([openai/codex#58545](https://github.com/openai/codex/issues/58545), [openai/codex#43869](https://github.com/openai/codex/issues/43869)) | Not tested | Yes | Yes | **Browser-extension agents keep running**; anything that must click the screen is covered |
|
|
30
36
|
| Covered browser windows keep full speed | No, the system treats them as hidden | Not tested | n/a | n/a | **Yes**: the cover is a tiny bit translucent, so the system still treats windows as visible |
|
|
31
37
|
| Prevents display sleep and system idle sleep | No: the display soon goes dark, and whether the Mac then sleeps depends on other apps ([anthropics/claude-code#81832](https://github.com/anthropics/claude-code/issues/81832)) | No | No | Yes | **Yes, while it is up** |
|
|
32
|
-
| Stays awake with the **lid closed** | No | No | No | No (sleep assertions cannot stop lid sleep) | **
|
|
38
|
+
| Stays awake with the **lid closed** | No | No | No | No (sleep assertions cannot stop lid sleep) | **Yes, on by default** once you allow it (`pmset disablesleep` with a one-time admin authorization, auto-restored) |
|
|
33
39
|
| Unlock | Touch ID or password | Key press (+ password) | n/a | n/a | **Just touch Touch ID**, or press any key / click for Touch ID or the login password |
|
|
34
40
|
| Shows what your agents are doing | No | No | No | No | **Yes** (themes that opt in: names, current step, running / waiting / done / stopped) |
|
|
35
41
|
|
|
@@ -45,31 +51,27 @@ use dsh-screensaver.
|
|
|
45
51
|
### As a DeepSeek Harness plugin
|
|
46
52
|
|
|
47
53
|
```bash
|
|
48
|
-
dsh plugin --profile web add
|
|
54
|
+
dsh plugin --profile web add dsh-screensaver
|
|
49
55
|
```
|
|
50
56
|
|
|
51
57
|
Use `desktop` instead of `web` for the desktop app profile, then restart dsh. The first start downloads the Electron
|
|
52
58
|
runtime (about 100 MB, once) and compiles the Touch ID helper if the Xcode Command Line Tools are installed.
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
dsh plugin --profile web add "github:realRoc/dsh-screensaver#path:/themes/subspace"
|
|
58
|
-
```
|
|
60
|
+
All three themes, Clock, Subspace Jump and Arcane Study, ship inside this package; there is nothing else to install.
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
Want the latest unreleased code from GitHub instead of the npm release:
|
|
61
63
|
|
|
62
64
|
```bash
|
|
63
|
-
dsh plugin --profile web add
|
|
64
|
-
dsh plugin --profile web add https://github.com/realRoc/dsh-screensaver/releases/latest/download/dsh-screensaver-theme-subspace.tgz
|
|
65
|
+
dsh plugin --profile web add github:realRoc/dsh-screensaver
|
|
65
66
|
```
|
|
66
67
|
|
|
67
68
|
### Without dsh
|
|
68
69
|
|
|
69
70
|
```bash
|
|
70
|
-
npx
|
|
71
|
-
npx
|
|
72
|
-
npx
|
|
71
|
+
npx dsh-screensaver --now # cover the screen now, exit after you unlock
|
|
72
|
+
npx dsh-screensaver # stay in the background, press ⌃⌥⌘L to start
|
|
73
|
+
npx dsh-screensaver --now subspace # with a theme
|
|
74
|
+
npx dsh-screensaver setup # settings: lid-closed awake (and its one-time authorization), theme, idle start
|
|
73
75
|
```
|
|
74
76
|
|
|
75
77
|
Requirements: macOS 12 or later, Node.js 22 or later. Touch-to-unlock needs a Mac with Touch ID (or a Magic Keyboard with
|
|
@@ -88,6 +90,7 @@ is used instead.
|
|
|
88
90
|
| --- | --- |
|
|
89
91
|
| `/screensaver` | Start with the default theme |
|
|
90
92
|
| `/screensaver <theme>` | Start with a theme, e.g. `/screensaver subspace` |
|
|
93
|
+
| `/screensaver <theme> <theme> …` | A theme per screen, main screen first, e.g. `/screensaver magic-tower subspace` |
|
|
91
94
|
| `/screensaver themes` | List installed themes |
|
|
92
95
|
| `/screensaver lid` | Show lid-closed awake status |
|
|
93
96
|
| `/screensaver lid authorize` | Allow lid-closed awake (asks for an admin password once; installs a sudoers rule that only allows `pmset -a disablesleep 0/1`) |
|
|
@@ -102,24 +105,71 @@ Add an entry to your profile's `~/.dsh/profiles/<profile>/cordis.patch.yml` (it
|
|
|
102
105
|
- id: dsh-screensaver
|
|
103
106
|
config:
|
|
104
107
|
theme: subspace # default theme id
|
|
108
|
+
screens: [magic-tower, subspace] # optional: a theme per screen (see "Several screens" below)
|
|
105
109
|
idleMinutes: 10 # start after 10 idle minutes; 0 = never (default)
|
|
106
|
-
lidAwake: true #
|
|
110
|
+
lidAwake: true # keep the Mac awake with the lid closed while the screen saver is up (default; false turns it off)
|
|
107
111
|
shortcut: Control+Alt+Command+L # Electron accelerator; '' disables the shortcut
|
|
108
112
|
```
|
|
109
113
|
|
|
110
|
-
Standalone,
|
|
114
|
+
Standalone, the same fields live in `~/.dsh/plugins-data/dsh-screensaver/config.json`:
|
|
115
|
+
|
|
116
|
+
| Command | What it does |
|
|
117
|
+
| --- | --- |
|
|
118
|
+
| `dsh-screensaver setup` | Walk through lid-closed awake (authorizes it on the spot), the theme, a theme per screen and idle start |
|
|
119
|
+
| `dsh-screensaver config` | Show the settings and the file they are saved in |
|
|
120
|
+
| `dsh-screensaver config <key> <value>` | Change one, e.g. `config lidAwake off`, `config idleMinutes 10`, `config screens magic-tower,subspace` |
|
|
121
|
+
| `dsh-screensaver config unset <key>` | Back to the default |
|
|
122
|
+
| `dsh-screensaver lid [status\|authorize\|revoke]` | Lid-closed awake authorization, same as `/screensaver lid` |
|
|
123
|
+
| `dsh-screensaver themes` | List installed themes |
|
|
124
|
+
|
|
125
|
+
`DSH_SCREENSAVER_CONFIG='{"theme":"subspace"}'` overrides the file for one run. A `--now` handed to a screen saver that is
|
|
126
|
+
already running (for example the one inside dsh) brings its `lidAwake` and `screens` along for that start when it sets them (in the file or the variable); otherwise the running one
|
|
127
|
+
uses its own config.
|
|
128
|
+
|
|
129
|
+
### Several screens
|
|
130
|
+
|
|
131
|
+
Every screen gets the same theme unless you set `screens`: a list of theme ids, one per screen. The first is the main
|
|
132
|
+
screen (the one with the menu bar), the rest go to the other screens from left to right (top to bottom when two share a
|
|
133
|
+
column), and screens beyond the end of the list use its last entry. `[magic-tower, subspace]` puts Arcane Study on the
|
|
134
|
+
main screen and Subspace Jump on every other one; `[magic-tower, subspace, basic]` gives a third screen the clock. A
|
|
135
|
+
screen plugged in while the screen saver is up gets its theme the same way. Naming one theme for a single start
|
|
136
|
+
(`--now subspace`, `/screensaver subspace`) uses it on every screen that time.
|
|
111
137
|
|
|
112
138
|
## Themes
|
|
113
139
|
|
|
114
|
-
| Theme | id |
|
|
140
|
+
| Theme | id | Ships with | Shows agent sessions |
|
|
115
141
|
| --- | --- | --- | --- |
|
|
116
142
|
| Clock | `basic` | built in | No |
|
|
117
|
-
| Subspace Jump | `subspace` |
|
|
143
|
+
| Subspace Jump | `subspace` | built in | Yes |
|
|
144
|
+
| Arcane Study | `magic-tower` | built in | Yes |
|
|
145
|
+
|
|
146
|
+
- **Subspace Jump**: three suns orbit in normal space; while agents run, the camera jumps into a warp tunnel that drifts
|
|
147
|
+
between a nebula storm, a vortex of ocean waves and a tunnel of Gaussian splats.
|
|
148
|
+
- **Arcane Study**: an HD-2D pixel scene. A knight reads by moonlight in a tower study; while agents run, the camera
|
|
149
|
+
dives into the book and the knight climbs the tower. Sessions are listed on a rune ledger, and the theme draws its own
|
|
150
|
+
status bar (with tonight's moon phase) and Touch ID ring in the same places as the shell.
|
|
151
|
+
|
|
152
|
+
In every theme the session list is on the left, the date and time at the top right and the Touch ID hint at the bottom
|
|
153
|
+
centre, and all of them fade out after 30 s without input, leaving only the scene.
|
|
118
154
|
|
|
119
|
-
|
|
155
|
+
Themes are visual works licensed CC BY-NC-SA 4.0 (no commercial use). A theme is a folder with an `index.html` (runs in a sandboxed iframe, draws only) and a
|
|
120
156
|
`saver.json`. Put your own in `~/.dsh/plugins-data/dsh-screensaver/themes/<id>/`, or publish it as an npm package with
|
|
121
157
|
`"dsh-screensaver": { "theme": "." }` in its `package.json`. See [docs/themes.md](docs/themes.md).
|
|
122
158
|
|
|
159
|
+
### Make your own theme
|
|
160
|
+
|
|
161
|
+
[`skills/dsh-screensaver-theme`](skills/dsh-screensaver-theme/SKILL.md) is an agent skill with the rules every theme
|
|
162
|
+
follows, whatever it looks like: an idle scene and a running scene with transitions, the session list, the status bar
|
|
163
|
+
and clock, Touch ID feedback, hiding after 30 s, secondary displays and battery, the `#demo` page, packaging, and a
|
|
164
|
+
script that records the two README GIFs. It leaves the art style entirely to you.
|
|
165
|
+
|
|
166
|
+
Copy the folder into `~/.claude/skills/` (or your project's `.claude/skills/`) for Claude Code, or point any coding
|
|
167
|
+
agent at `SKILL.md`, then describe your idea: "make a dsh-screensaver theme where…". Read the two reference themes in
|
|
168
|
+
`themes/` for working code.
|
|
169
|
+
|
|
170
|
+
New themes, wild ideas and improvements to the skill itself are all welcome: open a PR with your theme under `themes/`,
|
|
171
|
+
or an issue to pitch an idea. The skill is maintained together; if you hit a rule it doesn't cover, add it.
|
|
172
|
+
|
|
123
173
|
## Which agent sessions are detected
|
|
124
174
|
|
|
125
175
|
Only themes that set `"sessions": true` receive sessions, and only while the screen saver is up. Everything is read from
|
|
@@ -139,9 +189,10 @@ sessions. They are trademarks of their owners and are used only to identify thos
|
|
|
139
189
|
- A small always-on-top window covers each display; the primary one runs in kiosk mode (hides the Dock and menu bar,
|
|
140
190
|
blocks ⌘Tab and Force Quit).
|
|
141
191
|
- `desk-unlock`, a Swift helper (`native/unlock/main.swift`), embeds the system Touch ID view (`LAAuthenticationView`) in
|
|
142
|
-
an invisible window above the screen saver, so touching the sensor unlocks with no dialog.
|
|
192
|
+
an invisible window above the screen saver, so touching the sensor unlocks with no dialog. With the lid closed the
|
|
193
|
+
built-in sensor is off, so it waits for the lid to open (`AppleClamshellState`) and listens again right away. It also reads battery and
|
|
143
194
|
Wi-Fi for the status bar (IOKit, CoreWLAN; no location permission, the network name is not read).
|
|
144
|
-
- While up: `powerSaveBlocker('prevent-display-sleep')`. With `lidAwake
|
|
195
|
+
- While up: `powerSaveBlocker('prevent-display-sleep')`. With `lidAwake` (default) and the authorization: `pmset -a disablesleep 1`, restored when the
|
|
145
196
|
screen saver closes, when the process dies (a detached watchdog), at the next start if it was left on, and when the
|
|
146
197
|
battery drops to 20%.
|
|
147
198
|
|
|
@@ -151,7 +202,9 @@ sessions. They are trademarks of their owners and are used only to identify thos
|
|
|
151
202
|
Yes. Terminal agents are not affected at all, the Mac does not idle-sleep, and the display does not turn off.
|
|
152
203
|
|
|
153
204
|
**Does it work when I close the MacBook lid?**
|
|
154
|
-
|
|
205
|
+
Yes, after you allow it once: `/screensaver lid authorize` in dsh, or `dsh-screensaver lid authorize` (or `setup`)
|
|
206
|
+
standalone. `lidAwake` is on by default, so from then on every screen saver keeps the Mac awake with the lid closed;
|
|
207
|
+
set `lidAwake: false` to stop that.
|
|
155
208
|
Keep the Mac plugged in; it turns itself off at 20% battery.
|
|
156
209
|
|
|
157
210
|
**Is it a replacement for the macOS lock screen?**
|
|
@@ -159,7 +212,7 @@ No. It is a cover for when you step away at home or in the office and want your
|
|
|
159
212
|
security use ⌃⌘Q.
|
|
160
213
|
|
|
161
214
|
**Do I need DeepSeek Harness?**
|
|
162
|
-
No. `npx
|
|
215
|
+
No. `npx dsh-screensaver` runs it standalone. dsh adds the `/screensaver` command, the agent tool and
|
|
163
216
|
config.
|
|
164
217
|
|
|
165
218
|
**Does it work on Windows or Linux?**
|
|
@@ -176,15 +229,26 @@ git clone https://github.com/realRoc/dsh-screensaver && cd dsh-screensaver
|
|
|
176
229
|
npm install
|
|
177
230
|
npm test # vitest
|
|
178
231
|
npm run now # try it
|
|
179
|
-
npm run build:themes # rebuild themes
|
|
232
|
+
npm run build:themes # rebuild themes/*/index.html after editing themes/*/src
|
|
233
|
+
node skills/dsh-screensaver-theme/scripts/record-gif.mjs … # record README GIFs; usage at the top of the script
|
|
180
234
|
DSH_SCREENSAVER_DEBUG=1 npm run now # log page console messages
|
|
181
235
|
```
|
|
182
236
|
|
|
237
|
+
### Release
|
|
238
|
+
|
|
239
|
+
Pushing a `v*` tag runs [`.github/workflows/publish.yml`](.github/workflows/publish.yml), which tests and publishes
|
|
240
|
+
`dsh-screensaver` (themes included) to npm through Trusted Publishing (no token). A version already on npm is skipped.
|
|
241
|
+
|
|
242
|
+
1. Bump `version` in `package.json`. Rebuild `themes/subspace/index.html` first if the theme source changed.
|
|
243
|
+
2. Commit and push to `main`.
|
|
244
|
+
3. Tag and push: `git tag vX.Y.Z && git push origin vX.Y.Z`. The tag must match the root `package.json` version.
|
|
245
|
+
|
|
183
246
|
## License
|
|
184
247
|
|
|
185
248
|
Code is MIT ([LICENSE](LICENSE)). All visual assets, meaning every theme under `themes/` and the screenshots under
|
|
186
249
|
`docs/images/`, are **CC BY-NC-SA 4.0: no commercial use** ([LICENSE-ASSETS.md](LICENSE-ASSETS.md)). Third-party notices:
|
|
187
|
-
[themes/subspace/THIRD_PARTY_NOTICES.md](themes/subspace/THIRD_PARTY_NOTICES.md)
|
|
250
|
+
[themes/subspace/THIRD_PARTY_NOTICES.md](themes/subspace/THIRD_PARTY_NOTICES.md),
|
|
251
|
+
[themes/magic-tower/THIRD_PARTY_NOTICES.md](themes/magic-tower/THIRD_PARTY_NOTICES.md).
|
|
188
252
|
|
|
189
253
|
<!-- Keywords: screen saver for AI coding agents, keep Claude Code running when away, keep Codex running, prevent Mac sleep
|
|
190
254
|
while an agent runs, macOS lock screen alternative, Touch ID screen saver, keep Mac awake with lid closed, caffeinate
|
package/README.zh-CN.md
CHANGED
|
@@ -6,13 +6,18 @@ dsh-screensaver 就是为这种时候做的:样子跟 Mac 锁屏一样,回
|
|
|
6
6
|
|
|
7
7
|
它是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(dsh)插件,不装 dsh 也能用 `npx` 单独运行。
|
|
8
8
|
|
|
9
|
-
[English](README.md) · [llms.txt(写给 AI 看的简介)](llms.txt) · [主题开发](docs/themes.md) · [视觉素材授权](LICENSE-ASSETS.md)
|
|
9
|
+
[English](README.md) · [llms.txt(写给 AI 看的简介)](llms.txt) · [主题开发](docs/themes.md) · [主题 skill](skills/dsh-screensaver-theme/SKILL.md) · [视觉素材授权](LICENSE-ASSETS.md)
|
|
10
10
|
|
|
11
11
|

|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
亚空间跃迁和魔法书斋都有两幅画面:没有 agent 在跑时的静止画面,和 agent 在跑时的运动画面,会自己来回切换。
|
|
14
|
+
下面每段动图都是一幅画面 3 秒、转场、再另一幅画面 5 秒。时钟是仿 macOS 锁屏,没有动画场景,只有时间在走。
|
|
15
|
+
|
|
16
|
+
| | agent 开始跑:静止 → 运动 | agent 全部结束:运动 → 静止 |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| **亚空间跃迁**<br>`subspace` |  |  |
|
|
19
|
+
| **魔法书斋**<br>`magic-tower` |  |  |
|
|
20
|
+
| **时钟**<br>`basic` |  |  |
|
|
16
21
|
|
|
17
22
|
## 和系统锁屏、系统屏保、动态壁纸有什么不同
|
|
18
23
|
|
|
@@ -25,7 +30,7 @@ dsh-screensaver 就是为这种时候做的:样子跟 Mac 锁屏一样,回
|
|
|
25
30
|
| computer use 类 agent、靠浏览器扩展驱动的 agent | 会停([openai/codex#58545](https://github.com/openai/codex/issues/58545)、[openai/codex#43869](https://github.com/openai/codex/issues/43869)) | 未测试 | 照常 | 照常 | **浏览器扩展类照常运行**;需要点击屏幕的操作会被挡住 |
|
|
26
31
|
| 被盖住的浏览器窗口不降频 | 会降频,系统认为窗口不可见 | 未测试 | — | — | **不降频**:屏保保留了一点点透明度,系统仍认为窗口可见 |
|
|
27
32
|
| 不熄屏、不进入空闲睡眠 | 不管:锁屏后很快熄屏,之后睡不睡取决于其他程序([anthropics/claude-code#81832](https://github.com/anthropics/claude-code/issues/81832)) | 不管 | 不管 | 管 | **屏保期间一直管** |
|
|
28
|
-
| 合盖不睡 | 不行 | 不行 | 不行 | 不行(防睡眠断言管不了合盖) |
|
|
33
|
+
| 合盖不睡 | 不行 | 不行 | 不行 | 不行(防睡眠断言管不了合盖) | **默认开**,授权一次就生效(`pmset disablesleep`,退出后自动恢复) |
|
|
29
34
|
| 解锁 | Touch ID 或密码 | 按任意键(可能要输密码) | — | — | **直接摸 Touch ID**,或按键、点击后用 Touch ID / 登录密码 |
|
|
30
35
|
| 能看到 agent 在做什么 | 不能 | 不能 | 不能 | 不能 | **能**(支持会话的主题会显示名称、当前步骤和状态) |
|
|
31
36
|
|
|
@@ -39,30 +44,26 @@ dsh-screensaver 就是为这种时候做的:样子跟 Mac 锁屏一样,回
|
|
|
39
44
|
在 dsh 里使用:
|
|
40
45
|
|
|
41
46
|
```bash
|
|
42
|
-
dsh plugin --profile web add
|
|
47
|
+
dsh plugin --profile web add dsh-screensaver
|
|
43
48
|
```
|
|
44
49
|
|
|
45
50
|
DeepSeek Harness 桌面版把 `web` 换成 `desktop`。装好后重启 dsh。第一次启动会下载 Electron 运行时(约 100 MB,只下载一次);
|
|
46
51
|
如果装了 Xcode 命令行工具,还会在本机编译 Touch ID 小程序。
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
dsh plugin --profile web add "github:realRoc/dsh-screensaver#path:/themes/subspace"
|
|
52
|
-
```
|
|
53
|
+
「时钟」「亚空间跃迁」「魔法书斋」三个主题都随包自带,不用另装。
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
想用 GitHub 上还没发布的最新代码,而不是 npm 上的发布版:
|
|
55
56
|
|
|
56
57
|
```bash
|
|
57
|
-
dsh plugin --profile web add
|
|
58
|
-
dsh plugin --profile web add https://github.com/realRoc/dsh-screensaver/releases/latest/download/dsh-screensaver-theme-subspace.tgz
|
|
58
|
+
dsh plugin --profile web add github:realRoc/dsh-screensaver
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
不装 dsh 也能用:
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
npx
|
|
65
|
-
npx
|
|
64
|
+
npx dsh-screensaver --now # 立即开启,解锁后退出
|
|
65
|
+
npx dsh-screensaver # 在后台待命,按 ⌃⌥⌘L 开启
|
|
66
|
+
npx dsh-screensaver setup # 改配置:合盖不睡(顺手授权)、主题、空闲自动开启
|
|
66
67
|
```
|
|
67
68
|
|
|
68
69
|
系统要求:macOS 12 及以上,Node.js 22 及以上。想「摸一下就解锁」,需要带 Touch ID 的 Mac(或带 Touch ID 的妙控键盘),
|
|
@@ -78,6 +79,7 @@ npx github:realRoc/dsh-screensaver # 在后台待命,按 ⌃
|
|
|
78
79
|
| --- | --- |
|
|
79
80
|
| `/screensaver` | 用默认主题开启 |
|
|
80
81
|
| `/screensaver <主题>` | 用指定主题开启,例如 `/screensaver subspace` |
|
|
82
|
+
| `/screensaver <主题> <主题> …` | 每块屏幕一个主题,主屏第一,例如 `/screensaver magic-tower subspace` |
|
|
81
83
|
| `/screensaver themes` | 查看已安装的主题 |
|
|
82
84
|
| `/screensaver lid` | 查看合盖不睡的状态 |
|
|
83
85
|
| `/screensaver lid authorize` | 授权合盖不睡:输入一次管理员密码,安装一条只允许 `pmset -a disablesleep 0/1` 的 sudoers 规则 |
|
|
@@ -92,24 +94,62 @@ npx github:realRoc/dsh-screensaver # 在后台待命,按 ⌃
|
|
|
92
94
|
- id: dsh-screensaver
|
|
93
95
|
config:
|
|
94
96
|
theme: subspace # 默认主题
|
|
97
|
+
screens: [magic-tower, subspace] # 可选:每块屏幕不同的主题(见下面「多块屏幕」)
|
|
95
98
|
idleMinutes: 10 # 空闲 10 分钟自动开启;0 表示不自动开启(默认)
|
|
96
|
-
lidAwake: true #
|
|
99
|
+
lidAwake: true # 开启屏保时顺便打开合盖不睡(默认开,写 false 关掉)
|
|
97
100
|
shortcut: Control+Alt+Command+L # Electron 快捷键写法;填 '' 不注册快捷键
|
|
98
101
|
```
|
|
99
102
|
|
|
100
|
-
|
|
103
|
+
单独运行时,同样几项存在 `~/.dsh/plugins-data/dsh-screensaver/config.json`:
|
|
104
|
+
|
|
105
|
+
| 命令 | 作用 |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `dsh-screensaver setup` | 一问一答:合盖不睡(当场授权)、主题、每块屏幕的主题、空闲自动开启 |
|
|
108
|
+
| `dsh-screensaver config` | 查看配置和配置文件位置 |
|
|
109
|
+
| `dsh-screensaver config <项> <值>` | 改一项,例如 `config lidAwake off`、`config idleMinutes 10`、`config screens magic-tower,subspace` |
|
|
110
|
+
| `dsh-screensaver config unset <项>` | 改回默认 |
|
|
111
|
+
| `dsh-screensaver lid [status\|authorize\|revoke]` | 合盖不睡授权,同 `/screensaver lid` |
|
|
112
|
+
| `dsh-screensaver themes` | 查看已安装的主题 |
|
|
113
|
+
|
|
114
|
+
`DSH_SCREENSAVER_CONFIG='{"theme":"subspace"}'` 只对这一次生效,盖过配置文件。`--now` 交给已经在跑的屏保(比如 dsh 里那个)时,
|
|
115
|
+
如果这次写了 `lidAwake`、`screens`(配置文件或环境变量里),会一起带过去;没写就按那个屏保自己的配置。
|
|
116
|
+
|
|
117
|
+
### 多块屏幕
|
|
118
|
+
|
|
119
|
+
不写 `screens` 时所有屏幕用同一个主题。`screens` 是一串主题 id,一块屏幕一个:第一个给主屏(有菜单栏的那块),
|
|
120
|
+
其余按从左到右给别的屏幕(左右一样再从上到下),屏幕比列表多时,多出来的用最后一个。
|
|
121
|
+
`[magic-tower, subspace]` 就是主屏魔法书斋、其余屏幕亚空间跃迁;`[magic-tower, subspace, basic]` 让第三块屏幕显示时钟。
|
|
122
|
+
屏保开着时新插上的屏幕也按这个规则分。某一次明说了一个主题(`--now subspace`、`/screensaver subspace`),这一次所有屏幕都用它。
|
|
101
123
|
|
|
102
124
|
## 主题
|
|
103
125
|
|
|
104
|
-
| 主题 | id |
|
|
126
|
+
| 主题 | id | 来源 | 显示 agent 会话 |
|
|
105
127
|
| --- | --- | --- | --- |
|
|
106
128
|
| 时钟 | `basic` | 内置 | 否 |
|
|
107
|
-
| 亚空间跃迁 | `subspace` |
|
|
129
|
+
| 亚空间跃迁 | `subspace` | 内置 | 是 |
|
|
130
|
+
| 魔法书斋 | `magic-tower` | 内置 | 是 |
|
|
131
|
+
|
|
132
|
+
- **亚空间跃迁**:常规宇宙里三颗恒星绕转;agent 在跑时跃迁进亚空间隧道,在星云雷暴、浪涌龙卷、高斯粒子三种画风之间切换。
|
|
133
|
+
- **魔法书斋**:HD-2D 像素场景。塔顶书房里骑士在月光下读书;agent 在跑时镜头扎进书页、进塔,骑士沿书阶上行。左侧法卷列出会话,
|
|
134
|
+
右上角状态栏(带今晚的月相)和底部的触控 ID 法阵也由它自己画,位置跟外壳一样。
|
|
108
135
|
|
|
109
|
-
|
|
136
|
+
所有主题的布局一样:会话列表在左侧,日期时间在右上角,触控 ID 提示在底部正中;30 秒没人动就都淡掉,只剩画面。
|
|
137
|
+
|
|
138
|
+
每个主题就是一个文件夹:`index.html` 负责绘制(运行在沙盒 iframe 里),`saver.json` 写名称等信息。
|
|
110
139
|
自己做的主题放进 `~/.dsh/plugins-data/dsh-screensaver/themes/<id>/` 就能用,也可以发布成 npm 包,在 `package.json` 里写上
|
|
111
140
|
`"dsh-screensaver": { "theme": "." }`。详见 [docs/themes.md](docs/themes.md)。
|
|
112
141
|
|
|
142
|
+
### 做一个自己的主题
|
|
143
|
+
|
|
144
|
+
[`skills/dsh-screensaver-theme`](skills/dsh-screensaver-theme/SKILL.md) 是一个 agent skill,写的是每个主题都要守的规矩,不管画风:
|
|
145
|
+
静止画面和运动画面以及中间的转场、会话列表、右上角状态栏和时间、触控 ID 反馈、30 秒自动隐藏、副屏和用电池时降帧、`#demo` 演示页、打包,
|
|
146
|
+
还附了录 README 动图的脚本。画风完全由你定。
|
|
147
|
+
|
|
148
|
+
把这个文件夹复制到 `~/.claude/skills/`(或项目里的 `.claude/skills/`)给 Claude Code 用,或者让别的 coding agent 读 `SKILL.md`,
|
|
149
|
+
然后说出你的脑洞:「做一个 dsh-screensaver 主题,……」。`themes/` 里两个主题是可以照着看的完整实现。
|
|
150
|
+
|
|
151
|
+
欢迎新主题、新脑洞,也欢迎一起改进这个 skill:主题放到 `themes/` 下开 PR,想法可以先开 issue 聊。skill 大家一起维护,碰到它没写到的规矩就补上。
|
|
152
|
+
|
|
113
153
|
## 能识别哪些 agent 会话
|
|
114
154
|
|
|
115
155
|
只有声明了 `"sessions": true` 的主题才会收到会话信息,而且只在屏保开启时读取。每 2 秒读一次本机文件,不联网,不上传任何数据。
|
|
@@ -128,14 +168,15 @@ npx github:realRoc/dsh-screensaver # 在后台待命,按 ⌃
|
|
|
128
168
|
不会。终端里的 agent 完全不受影响,电脑不会空闲睡眠,屏幕也不会熄灭。
|
|
129
169
|
|
|
130
170
|
**合上 MacBook 盖子还能继续跑吗?**
|
|
131
|
-
|
|
171
|
+
可以,授权一次就行:dsh 里执行 `/screensaver lid authorize`,单独运行时执行 `dsh-screensaver lid authorize`(或 `setup`)。
|
|
172
|
+
`lidAwake` 默认开,之后每次开屏保都会合盖不睡;不想要就设 `lidAwake: false`。
|
|
132
173
|
建议插着电源;用电池且电量降到 20% 时会自动恢复睡眠。
|
|
133
174
|
|
|
134
175
|
**能代替 macOS 锁屏吗?**
|
|
135
176
|
不能。它适合在家或办公室临时走开、又想让 agent 继续工作的场景。需要真正的安全保护时,请用 ⌃⌘Q。
|
|
136
177
|
|
|
137
178
|
**一定要装 DeepSeek Harness 吗?**
|
|
138
|
-
不用。`npx
|
|
179
|
+
不用。`npx dsh-screensaver` 可以单独运行。装在 dsh 里会多出 `/screensaver` 命令、agent 可调用的工具和配置项。
|
|
139
180
|
|
|
140
181
|
**支持 Windows 或 Linux 吗?**
|
|
141
182
|
暂时只支持 macOS。
|
|
@@ -150,10 +191,20 @@ git clone https://github.com/realRoc/dsh-screensaver && cd dsh-screensaver
|
|
|
150
191
|
npm install
|
|
151
192
|
npm test # 运行测试(vitest)
|
|
152
193
|
npm run now # 立即开启屏保试一下
|
|
153
|
-
npm run build:themes # 修改 themes
|
|
194
|
+
npm run build:themes # 修改 themes/*/src 后重新打包 index.html
|
|
195
|
+
node skills/dsh-screensaver-theme/scripts/record-gif.mjs … # 录 README 动图,用法见脚本开头的注释
|
|
154
196
|
DSH_SCREENSAVER_DEBUG=1 npm run now # 打印页面里的 console 输出
|
|
155
197
|
```
|
|
156
198
|
|
|
199
|
+
### 发版
|
|
200
|
+
|
|
201
|
+
推送 `v*` 标签会触发 [`.github/workflows/publish.yml`](.github/workflows/publish.yml):跑测试,再通过 Trusted Publishing(不用令牌)
|
|
202
|
+
把 `dsh-screensaver`(含主题)发到 npm。这个版本 npm 上已有就跳过。
|
|
203
|
+
|
|
204
|
+
1. 改 `package.json` 的 `version`。主题源码改过的话先重新打包 `themes/subspace/index.html`。
|
|
205
|
+
2. 提交并推送到 `main`。
|
|
206
|
+
3. 打标签并推送:`git tag vX.Y.Z && git push origin vX.Y.Z`。标签必须和根目录 `package.json` 的版本一致。
|
|
207
|
+
|
|
157
208
|
## 授权
|
|
158
209
|
|
|
159
210
|
代码采用 MIT;所有主题(`themes/`)和截图(`docs/images/`)等视觉素材采用 **CC BY-NC-SA 4.0,禁止商用**。
|
package/app/main.js
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
//
|
|
3
3
|
// 1. dsh 插件的子进程(lib/index.js 起的,DSH_SCREENSAVER_CONTROL=stdin):
|
|
4
4
|
// stdin 一行一条 JSON 指令,stdout 回 JSON(都带 "$" 字段,别的输出当日志),stdin 断了(dsh 退出)就收尾退出。
|
|
5
|
-
// → { "$": "start", "theme": "subspace" } 开屏保(theme
|
|
5
|
+
// → { "$": "start", "theme": "subspace" } 开屏保(theme 可省;给了就所有屏幕都用它)
|
|
6
|
+
// → { "$": "start", "screens": ["magic-tower", "subspace"] } 这一次每块屏幕的主题(主屏第一,见 screens.js)
|
|
6
7
|
// → { "$": "config", "config": { ... } } 改配置
|
|
7
8
|
// → { "$": "themes", "id": 1 } 列主题 ← { "$": "reply", "id": 1, "result": [...] }
|
|
8
9
|
// → { "$": "lid", "action": "status|authorize|revoke|on|off", "id": 2 }
|
|
9
10
|
// ← { "$": "state", "active": true } 屏保开了 / 关了
|
|
10
11
|
// 2. 单独跑(bin/dsh-screensaver.js):`--now [主题]` 马上开,解开后退出;不带就常驻,等快捷键 / 空闲自动开。
|
|
11
|
-
// 配置从 DSH_SCREENSAVER_CONFIG(JSON
|
|
12
|
+
// 配置从 DSH_SCREENSAVER_CONFIG(JSON)读(bin/ 把数据目录的 config.json 和调用方带的合好了放进来)。
|
|
12
13
|
import { app, dialog } from 'electron'
|
|
13
14
|
import { registerScheme, serveScheme } from './paths.js'
|
|
14
15
|
import { saverLang, Screensaver } from './saver.js'
|
|
@@ -19,11 +20,6 @@ const now = nowAt >= 0
|
|
|
19
20
|
const nowTheme = now && argv[nowAt + 1] && !argv[nowAt + 1].startsWith('-') ? argv[nowAt + 1] : undefined
|
|
20
21
|
const controlled = process.env.DSH_SCREENSAVER_CONTROL === 'stdin'
|
|
21
22
|
|
|
22
|
-
// 同一时间只开一个:第二次 `dsh-screensaver --now` 交给已经在跑的那个去开
|
|
23
|
-
if (!app.requestSingleInstanceLock({ now, theme: nowTheme })) app.exit(0)
|
|
24
|
-
registerScheme()
|
|
25
|
-
app.dock?.hide() // 不进程序坞,不抢 Cmd+Tab
|
|
26
|
-
|
|
27
23
|
function readConfig() {
|
|
28
24
|
try {
|
|
29
25
|
return JSON.parse(process.env.DSH_SCREENSAVER_CONFIG || '{}')
|
|
@@ -32,6 +28,12 @@ function readConfig() {
|
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
30
|
|
|
31
|
+
// 同一时间只开一个:第二次 `dsh-screensaver --now` 交给已经在跑的那个去开,
|
|
32
|
+
// 连同这次明说了的合盖不睡、每块屏幕的主题(比如桌宠开的、dsh 里配的是关,这一次也按桌宠的来);没说就按那个实例自己的配置
|
|
33
|
+
if (!app.requestSingleInstanceLock({ now, theme: nowTheme, lidAwake: readConfig().lidAwake, screens: readConfig().screens })) app.exit(0)
|
|
34
|
+
registerScheme()
|
|
35
|
+
app.dock?.hide() // 不进程序坞,不抢 Cmd+Tab
|
|
36
|
+
|
|
35
37
|
const send = (msg) => process.stdout.write(`${JSON.stringify(msg)}\n`)
|
|
36
38
|
let saver = null
|
|
37
39
|
let quitting = false
|
|
@@ -49,7 +51,7 @@ async function handle(msg) {
|
|
|
49
51
|
try {
|
|
50
52
|
switch (msg.$) {
|
|
51
53
|
case 'start':
|
|
52
|
-
await saver.start(msg.theme)
|
|
54
|
+
await saver.start(msg.theme, Array.isArray(msg.screens) ? { screens: msg.screens } : {})
|
|
53
55
|
return reply(true)
|
|
54
56
|
case 'config':
|
|
55
57
|
saver.applyConfig(msg.config ?? {})
|
|
@@ -108,7 +110,7 @@ async function main() {
|
|
|
108
110
|
},
|
|
109
111
|
})
|
|
110
112
|
app.on('second-instance', (_e, _argv, _cwd, data) => {
|
|
111
|
-
if (data?.now) void saver.start(data.theme)
|
|
113
|
+
if (data?.now) void saver.start(data.theme, { lidAwake: data.lidAwake, screens: Array.isArray(data.screens) ? data.screens : undefined })
|
|
112
114
|
})
|
|
113
115
|
app.on('window-all-closed', () => {}) // 屏保关了程序不退:等下一次快捷键 / 指令
|
|
114
116
|
app.on('before-quit', (e) => {
|