dsh-theme-engine 0.0.0-stage → 26.11.21-184500
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 +202 -0
- package/NOTICE +4 -0
- package/README.en.md +201 -0
- package/README.md +200 -2
- package/bin/lg-capture.exe +0 -0
- package/client/client.js +7368 -0
- package/client/src/01-bootstrap.js +159 -0
- package/client/src/02-locale.js +487 -0
- package/client/src/03-settings.js +337 -0
- package/client/src/04-capture.js +386 -0
- package/client/src/05-ink.js +66 -0
- package/client/src/06-guard.js +89 -0
- package/client/src/07-styles.js +1724 -0
- package/client/src/08-shaders.js +176 -0
- package/client/src/09-webgpu.js +661 -0
- package/client/src/10-webgl.js +848 -0
- package/client/src/11-ui.js +43 -0
- package/client/src/12-apply.js +1485 -0
- package/client/src/13-we.js +652 -0
- package/client/src/14-audio.js +249 -0
- package/client/src/_epilogue.js +3 -0
- package/client/src/_prologue.js +3 -0
- package/cordis.patch.yml +8 -0
- package/docs/DETAIL.md +294 -0
- package/docs/screenshot.png +0 -0
- package/host/helper.js +528 -0
- package/host/paths.js +31 -0
- package/host/run.js +46 -0
- package/host/scripts.js +156 -0
- package/host/update-check.js +244 -0
- package/host/wallpaper-engine.js +399 -0
- package/host/wallpaper.js +200 -0
- package/icon.svg +19 -0
- package/index.js +619 -0
- package/locale/en.json +222 -0
- package/locale/zh.json +222 -0
- package/package.json +57 -4
- package/scripts/build-capture.mjs +65 -0
- package/scripts/build-client.mjs +76 -0
- package/tools/capture/lg-capture.cpp +1118 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.en.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
[中文](README.md) · **[English](README.en.md)**
|
|
4
|
+
|
|
5
|
+
# DSH Theme Engine
|
|
6
|
+
|
|
7
|
+
**Your desktop sits behind glass. Your wallpapers obey you.**
|
|
8
|
+
|
|
9
|
+
[](https://github.com/ShuoweiFu/DSH-Theme-Engine/tags)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](#known-edges)
|
|
12
|
+
[](https://github.com/ShuoweiFu/DSH-Theme-Engine/stargazers)
|
|
13
|
+
|
|
14
|
+
Version **v.26.11.21.175000** · Apache-2.0 · DSH Desktop on Windows only
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## What problem this solves
|
|
23
|
+
|
|
24
|
+
DSH is square, opaque and unrelated to your desktop. This plugin does three things:
|
|
25
|
+
|
|
26
|
+
1. **Replaces the background** — a live desktop capture, a picture / video / gif you point at, or whatever Wallpaper Engine is playing right now.
|
|
27
|
+
2. **Lifts the interface off it** — panels, sidebar and composer all become the same sheet of glass: wide-radius blur on the GPU, text that picks black or white from the background luminance, and a caret that takes the inverse of that ink.
|
|
28
|
+
3. **Hands you the wallpaper controls** — a centre built against Wallpaper Engine's own property panel: library, search, type filters, alignment, position, flip, speed, volume, preset import/export.
|
|
29
|
+
|
|
30
|
+
The plugin registers no agent tools and injects no prompt text, so it **costs you zero tokens**.
|
|
31
|
+
|
|
32
|
+
## Three backgrounds, one at a time
|
|
33
|
+
|
|
34
|
+
| Module | Where the background comes from | When it exists |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| Liquid glass | Live desktop capture, or a file / URL you pick | Always (built in) |
|
|
37
|
+
| Wallpaper engine | Your local Steam / Wallpaper Engine library; scene and web projects are played by WE, then captured | Always; a reduced shape when WE is missing |
|
|
38
|
+
| elysia395 compatible | [elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine) | Only when that plugin is detected |
|
|
39
|
+
|
|
40
|
+
They are mutually exclusive: one sheet of glass supplies the background at any moment. The **island** is not one of them — it is an independent overlay and can be on with any module.
|
|
41
|
+
|
|
42
|
+
## Thirty seconds to running
|
|
43
|
+
|
|
44
|
+
Requirements: Windows 10 20348+ / Windows 11, DSH Desktop.
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
# from a release bundle
|
|
48
|
+
plugin_manager install_bundle target="<downloaded .tgz>"
|
|
49
|
+
|
|
50
|
+
# from source
|
|
51
|
+
git clone https://github.com/ShuoweiFu/DSH-Theme-Engine.git
|
|
52
|
+
plugin_manager install_bundle target="<absolute path to the clone>"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Reload the page: a **Theme Engine** row appears in the sidebar. Click it and the settings page fills the main work area.
|
|
56
|
+
|
|
57
|
+
Client-only changes need a Ctrl+R. Changes to `index.js` or `host/` need a DSH restart, otherwise the new routes simply do not exist.
|
|
58
|
+
|
|
59
|
+
## The wallpaper centre, modelled on Wallpaper Engine
|
|
60
|
+
|
|
61
|
+
The wallpaper branch is one top-to-bottom pipeline: **switch → library → property sheet → presets → local file**.
|
|
62
|
+
|
|
63
|
+
### Library
|
|
64
|
+
|
|
65
|
+
It reads Steam's `libraryfolders.vdf`, then `steamapps/workshop/431960/*/project.json` plus WE's own `config.json`, and lists video / scene / web projects as a preview grid with search and type filters. Type is labelled on every card; scene and web projects also carry a gold `WE` badge, because only WE itself can render them.
|
|
66
|
+
|
|
67
|
+
### Property sheet
|
|
68
|
+
|
|
69
|
+
One-to-one with WE's right-hand panel; edits apply to the wallpaper already on screen:
|
|
70
|
+
|
|
71
|
+
| Control | Range | What it does |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| Alignment | cover / contain / stretch / pixel | How the wallpaper fills the screen; pixel scales without interpolation, for pixel art |
|
|
74
|
+
| Position X / Y | 0–100 | Pans under any alignment; 50/50 is centred |
|
|
75
|
+
| Flip X / Y | on / off | Horizontal and vertical mirror |
|
|
76
|
+
| Playback speed | 0.25–2.00× | Rate for video wallpapers and animations |
|
|
77
|
+
| Volume | 0–1 | The wallpaper's own audio track |
|
|
78
|
+
| Mute | on / off | Toggles `muted` only, so the video is never reloaded and never flashes |
|
|
79
|
+
| Reset | — | Returns every control above to its default in one click |
|
|
80
|
+
|
|
81
|
+
Alignment, position and flip are computed as UVs inside the fragment shader (`uFit`, `uPan`, `uFlip`), not in CSS — they ride the same sampling pass as the glass blur instead of opening a second render path.
|
|
82
|
+
|
|
83
|
+
### Presets
|
|
84
|
+
|
|
85
|
+
Name and save the current parameter set, load, delete, export it as JSON, or paste JSON back in — up to 24. A preset stores numbers, not the wallpaper, so it travels between machines.
|
|
86
|
+
|
|
87
|
+
### What it looks like without Wallpaper Engine
|
|
88
|
+
|
|
89
|
+
Deliberately different: **no WE, different UI**. The grid, search, type filters, "open WE" and "Steam store" buttons are not rendered at all. What remains is
|
|
90
|
+
|
|
91
|
+
- a status line saying WE was not detected
|
|
92
|
+
- the Steam store link, if you want to install it
|
|
93
|
+
- the full property sheet (local video and images honour alignment, position, flip and speed too)
|
|
94
|
+
- the local file picker
|
|
95
|
+
|
|
96
|
+
Nothing that looks clickable but does nothing.
|
|
97
|
+
|
|
98
|
+
### How scene and web wallpapers switch
|
|
99
|
+
|
|
100
|
+
Those two cannot be rendered by the client, so the plugin runs
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
wallpaper64.exe -control openWallpaper -file <project.json>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
asks WE to switch, calls `invalidate()` on its cache, waits 1200 ms and re-reads WE state before capturing the desktop again. It returns `{ ok, switched, id, title, type, file }`, and the UI reports the outcome.
|
|
107
|
+
|
|
108
|
+
## Where the "black flash on loop" went
|
|
109
|
+
|
|
110
|
+
When a video loops back to 0:00, the decoder often emits a near-black frame first. The plugin uploads the current frame with `texSubImage2D` on a 110 ms timer — so that one frame blacks out the glass for a moment.
|
|
111
|
+
|
|
112
|
+
The fix is not "drop every dark frame" (that would eat night-time wallpapers and genuine fades). It reuses `isBlackSwap` from the ink detector:
|
|
113
|
+
|
|
114
|
+
- reject only when the **previous frame was bright** and this one drops under the black threshold
|
|
115
|
+
- never reject more than two frames in a row; the third uploads no matter how dark, so playback can never get stuck
|
|
116
|
+
- a dark wallpaper is dark throughout and never trips the rule
|
|
117
|
+
|
|
118
|
+
Both upload paths — WebGL and WebGPU — have the guard.
|
|
119
|
+
|
|
120
|
+
## The glass itself
|
|
121
|
+
|
|
122
|
+
- **Blur**: 13-tap Poisson-kernel Gaussian. WebGL ping-pongs it 1–4 times to build radius; WebGPU runs a dedicated WGSL pre-pass. At maximum `blur` you get a wide, smooth falloff, not a truncated CSS blur.
|
|
123
|
+
- **Occluded windows**: browsers, editors and players sitting under DSH are cropped by screen coordinates and pasted back behind the glass; rounded corners and transparent regions use premultiplied alpha, so no black edges. One capture costs 0.02–0.06 s and can be switched off.
|
|
124
|
+
- **Text**: flips between black and white by background luminance, targeting WCAG 7:1. Once you pick a colour by hand, nothing overrides it.
|
|
125
|
+
- **Caret**: the **inverse** of the ink — white on dark text, black on light text. CSS only exposes `caret-color`, so this is the most reliable form of it.
|
|
126
|
+
- **Five colour modes**: auto / light / dark / custom / intelligent. Intelligent samples the dominant colour from whatever is behind the glass and flips light/dark by luminance; switching animates over 240 ms and yields the moment you drag a slider.
|
|
127
|
+
- **Stored per module**: every background module keeps its own appearance values, and every colour mode keeps its own bucket inside that, so switching never overwrites the other.
|
|
128
|
+
|
|
129
|
+
## Performance: read the tier before forcing FPS
|
|
130
|
+
|
|
131
|
+
The GPU string is read once at startup (`WEBGL_debug_renderer_info`, locally, never uploaded) and mapped to a tier.
|
|
132
|
+
|
|
133
|
+
| GPU | Default tier | Backend | FPS | Dynamic resolution |
|
|
134
|
+
| --- | --- | --- | --- | --- |
|
|
135
|
+
| Intel Iris Xe / UHD / HD, AMD Radeon / Vega APU, Apple M | 🛡 iGPU safe | WebGL | 30 | ✅ |
|
|
136
|
+
| Unknown / VM / software (SwiftShader, llvmpipe) | 🛡 iGPU safe | WebGL | 30 | ✅ |
|
|
137
|
+
| GTX 10 / 16, RTX 20 / 30, RX 5000–7000, Arc A | ⚖ Balanced | WebGL | 60 | ✅ |
|
|
138
|
+
| RTX 40 / 50, RX 9000, Arc B, RTX A | 🔥 Beast | WebGPU (falls back to WebGL) | 144 | ❌ |
|
|
139
|
+
|
|
140
|
+
> A measured counter-example: i7-12700H + Iris Xe + 10 GB LPDDR5, frame cap lifted and dynamic resolution off — 10 minutes later the GPU sat at 96 °C and the machine blue-screened. An iGPU has no dedicated VRAM; every frame above 40 FPS is just heat.
|
|
141
|
+
|
|
142
|
+
Hence five layers of protection: over-budget frame time → lower resolution (1.0 → 0.8 → 0.65 → 0.5) → drop occlusion compositing → static translucent mask → disable; five seconds over budget or a `webglcontextlost` drops straight to the safe profile.
|
|
143
|
+
|
|
144
|
+
| Baseline (i7-12700H / Iris Xe / 2520×1680@150%) | Value |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| Frame render 1680×1119 (scale 1.0) | 16.9 ms |
|
|
147
|
+
| Frame render 1344×895 (scale 0.8, default) | ≈10–11 ms |
|
|
148
|
+
| Plugin VRAM delta | 20–25 MB |
|
|
149
|
+
| One capture frame (WGC + compose + JPEG) | ≈32 ms mean (8 fps cap) |
|
|
150
|
+
| Desktop at rest | no encoding, no repaint |
|
|
151
|
+
|
|
152
|
+
## Settings at a glance
|
|
153
|
+
|
|
154
|
+
**Appearance** (one copy per module): blur 10 px, saturation 1.4, tint 55%, frost 34% (the only thickness slider), wallpaper dim 8%, flow 0.9 (0 = render on demand), ink auto, colour mode auto, custom colour `#8ab4ff`, auto light/dark on.
|
|
155
|
+
|
|
156
|
+
**Wallpaper**: liquid glass on, WE library auto, alignment cover, position 50/50, flip off, speed 1.00×, volume 0, mute on, up to 24 presets, local files in image / video / gif / apng.
|
|
157
|
+
|
|
158
|
+
**Sound**: local playlists (mp3 / flac / wav / ogg / m4a / aac / opus, 0.25–2.0×, volume) or system audio (permission required, **analysis only, never replayed**). Energy feeds the shader live — the surface rises on bass.
|
|
159
|
+
|
|
160
|
+
**Performance**: smart preset follows the GPU, backend WebGL / WebGPU, max FPS 30 / 60 / 144 by tier, dynamic resolution on, occlusion compositing by tier, wallpaper refresh auto (8 fps stream + 0.22 s digest + 420 ms cross-fade).
|
|
161
|
+
|
|
162
|
+
## Known edges
|
|
163
|
+
|
|
164
|
+
- Maps the primary monitor only.
|
|
165
|
+
- Occluded UWP / DRM / minimised windows may be empty surfaces: skipped rather than pasted black, still listed in `apps`.
|
|
166
|
+
- Borderless capture needs Windows 11 / 10 20348+; older systems get the yellow capture border back, and the background keeps refreshing.
|
|
167
|
+
- Minimised windows stop the render loop — Chromium behaviour, and a power saving one.
|
|
168
|
+
- Switching scene / web wallpapers depends on WE itself; without WE installed or running those two types only show a hint.
|
|
169
|
+
- Speed and volume apply to `<video>` wallpapers and animations; scene wallpapers are tuned inside WE.
|
|
170
|
+
- Non-Windows platforms get no occlusion compositing — static wallpaper files only.
|
|
171
|
+
- The elysia395 branch is a placeholder: it appears when detected, and settings takeover/migration is still in progress.
|
|
172
|
+
|
|
173
|
+
## Ecosystem
|
|
174
|
+
|
|
175
|
+
- **Wallpaper Engine** (Steam AppID `431960`): library scanning, project typing and property semantics all follow it; scene and web wallpapers are played by it.
|
|
176
|
+
- **[elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine)**: the compatibility target of the third module. Both can be installed; only one supplies the background at a time.
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
```powershell
|
|
181
|
+
pnpm build:client # client/src/*.js → client/client.js (Node.js only, no third-party deps)
|
|
182
|
+
pnpm build:capture # tools/capture/lg-capture.cpp → bin/lg-capture.exe (needs clang++, override with LG_CLANG)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
| Path | Role |
|
|
186
|
+
| --- | --- |
|
|
187
|
+
| `index.js` | Host entry: `/liquid-glass/*` routes (including `/we/open`), capture scheduling, module state, update check |
|
|
188
|
+
| `host/` | Wallpaper detection, WE bridge (scan / preview / switch), persistent capture helper, PowerShell fallback, update check |
|
|
189
|
+
| `client/src/` | Front-end sources concatenated `01` → `14` (13 = wallpaper centre and colour modes, 14 = audio matrix) |
|
|
190
|
+
| `client/client.js` | Build output, loaded by DSH through `exports["./client"]` |
|
|
191
|
+
| `tools/capture/lg-capture.cpp` | Native capture / compositing helper (WGC + GDI+) |
|
|
192
|
+
| `bin/lg-capture.exe` | Prebuilt helper shipped with the plugin |
|
|
193
|
+
| `docs/DETAIL.md` | Compositing, screen-space mapping, the five-layer guard, shader parameters, module data shapes |
|
|
194
|
+
|
|
195
|
+
Please include host/plugin versions, OS, GPU, reproduction steps and redacted logs in issues.
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
[Apache License 2.0](LICENSE) © DSH Theme Engine contributors
|
|
200
|
+
|
|
201
|
+
Commercial use, modification and redistribution are allowed with copyright and licence notices retained. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
package/README.md
CHANGED
|
@@ -1,3 +1,201 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**[中文](README.md)** · [English](README.en.md)
|
|
4
|
+
|
|
5
|
+
# DSH Theme Engine
|
|
6
|
+
|
|
7
|
+
**桌面在玻璃后面,壁纸归你管。**
|
|
8
|
+
|
|
9
|
+
[](https://github.com/ShuoweiFu/DSH-Theme-Engine/tags)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](#已知边界)
|
|
12
|
+
[](https://github.com/ShuoweiFu/DSH-Theme-Engine/stargazers)
|
|
13
|
+
|
|
14
|
+
当前版本 **v.26.11.21.175000** · Apache-2.0 · 只跑在 Windows 上的 DSH 桌面版
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 它解决什么问题
|
|
23
|
+
|
|
24
|
+
DSH 的界面是方的、不透明的、和桌面无关。这个插件做三件事:
|
|
25
|
+
|
|
26
|
+
1. **把背景换掉** —— 桌面实时捕获,或者你指定的图片 / 视频 / gif,或者 Wallpaper Engine 正在播的那张。
|
|
27
|
+
2. **让界面浮起来** —— 面板、侧边栏、输入框都变成同一块玻璃:GPU shader 做的大半径模糊、按背景亮度自动定文字黑白、光标取文字的反色。
|
|
28
|
+
3. **让你能管壁纸** —— 一个对着 Wallpaper Engine 属性栏做的中枢:库、搜索、类型筛选、对齐方式、位置、翻转、倍速、音量、预设导入导出。
|
|
29
|
+
|
|
30
|
+
插件不注册 agent 工具、不往提示里塞字,**不花你一个 token**。
|
|
31
|
+
|
|
32
|
+
## 三种背景,同一时间只开一种
|
|
33
|
+
|
|
34
|
+
| 模块 | 背景从哪来 | 什么时候出现 |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| 液态玻璃背景 | 本机桌面捕获,或你指的文件 / URL | 一直有(内置) |
|
|
37
|
+
| 壁纸引擎 | 你本机 Steam 里的 Wallpaper Engine 库;场景 / 网页交给 WE 播放后捕获 | 一直有;没装 WE 时是简化形态 |
|
|
38
|
+
| elysia395 兼容 | [elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine) | 检测到那个插件才出现 |
|
|
39
|
+
|
|
40
|
+
三者互斥——同一时刻只有一块玻璃在供背景。**灵动岛**不属于它们,是独立叠加层,开哪个背景都能开。
|
|
41
|
+
|
|
42
|
+
## 三十秒上手
|
|
43
|
+
|
|
44
|
+
前提:Windows 10 20348+ / Windows 11、DSH 桌面版。
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
# 装:Release 包
|
|
48
|
+
plugin_manager install_bundle target="<下载的 .tgz>"
|
|
49
|
+
|
|
50
|
+
# 装:源码
|
|
51
|
+
git clone https://github.com/ShuoweiFu/DSH-Theme-Engine.git
|
|
52
|
+
plugin_manager install_bundle target="<clone 出来的绝对路径>"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
刷新页面 → 侧边栏多一行 **主题引擎** → 点开,设置页整页铺在右侧主工作区。
|
|
56
|
+
|
|
57
|
+
改 `client/` 只需 Ctrl+R;改 `index.js` 或 `host/` 必须重启 DSH,否则新路由不存在。
|
|
58
|
+
|
|
59
|
+
## 壁纸中枢:照着 Wallpaper Engine 做的
|
|
60
|
+
|
|
61
|
+
壁纸引擎分支从上到下就是一条流水线:**开关 → 库 → 属性 → 预设 → 本地文件**。
|
|
62
|
+
|
|
63
|
+
### 库
|
|
64
|
+
|
|
65
|
+
扫描 Steam 的 `libraryfolders.vdf`,再读 `steamapps/workshop/431960/*/project.json` 与 WE 自己的 `config.json`,把视频 / 场景 / 网页三类项目列成缩略图网格,带搜索框和类型筛选。每条都标了类型;场景与网页项目多一枚金色 `WE` 角标,因为它们的画面只能由 WE 本体渲染。
|
|
66
|
+
|
|
67
|
+
### 属性
|
|
68
|
+
|
|
69
|
+
和 WE 右侧属性栏一一对应,改完立刻作用到当前壁纸:
|
|
70
|
+
|
|
71
|
+
| 项 | 取值 | 作用 |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| 对齐方式 | 覆盖 / 适应 / 拉伸 / 逐像素 | 壁纸铺满屏幕的方式;逐像素只放大不插值,适合像素画 |
|
|
74
|
+
| 位置 X / Y | 0–100 | 任意对齐方式下都能平移,50/50 为居中 |
|
|
75
|
+
| 翻转 X / Y | 开 / 关 | 水平、垂直镜像 |
|
|
76
|
+
| 播放速度 | 0.25–2.00× | 视频壁纸与动态图的播放倍率 |
|
|
77
|
+
| 音量 | 0–1 | 壁纸自带音轨 |
|
|
78
|
+
| 静音 | 开 / 关 | 只切 `muted`,不重新加载视频,所以不会闪一下 |
|
|
79
|
+
| 恢复默认 | — | 一次把上面全部拉回初始值 |
|
|
80
|
+
|
|
81
|
+
对齐、位置、翻转由片元着色器里的 `uFit` / `uPan` / `uFlip` 直接算 UV,不经过 CSS,所以和玻璃模糊是同一趟采样,不额外开一条渲染链路。
|
|
82
|
+
|
|
83
|
+
### 预设
|
|
84
|
+
|
|
85
|
+
命名保存当前这一组参数,支持加载、删除、导出成 JSON、把 JSON 粘回来导入,最多 24 条。预设只存壁纸参数,不存壁纸本身——换机器照样能用,只要把参数带上。
|
|
86
|
+
|
|
87
|
+
### 没装 Wallpaper Engine 的样子
|
|
88
|
+
|
|
89
|
+
这是刻意的:**检测不到 WE 就换一套界面**。库网格、搜索、类型筛选、「打开 WE」「Steam 商店」按钮全部不渲染,只留
|
|
90
|
+
|
|
91
|
+
- 一行状态说明(未检测到 WE)
|
|
92
|
+
- Steam 商店入口(想装的时候点)
|
|
93
|
+
- 完整的属性面板(本地视频和图片同样吃对齐、位置、翻转、倍速)
|
|
94
|
+
- 本地文件选择器
|
|
95
|
+
|
|
96
|
+
不会出现一排点了没反应的按钮。
|
|
97
|
+
|
|
98
|
+
### 场景 / 网页壁纸怎么切
|
|
99
|
+
|
|
100
|
+
这两类自己渲染不了,插件会调
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
wallpaper64.exe -control openWallpaper -file <project.json>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
让 WE 本体换壁纸,`invalidate()` 清缓存后等 1200 ms 再复核一次 WE 状态,然后照常从桌面捕获进玻璃。返回 `{ ok, switched, id, title, type, file }`,界面按结果给提示。
|
|
107
|
+
|
|
108
|
+
## 「循环播放黑一下」是怎么没的
|
|
109
|
+
|
|
110
|
+
视频循环回到 0:00 时,解码器常会先吐一帧近黑再继续。插件用 110 ms 的定时器把当前帧 `texSubImage2D` 上传纹理——只要那一帧是黑的,玻璃后面就会黑一下。
|
|
111
|
+
|
|
112
|
+
修法不是"见到黑就丢"(那会把夜景壁纸和真正的淡出一起吃掉),而是复用墨色检测里已有的 `isBlackSwap`:
|
|
113
|
+
|
|
114
|
+
- 只有在**上一帧是亮的**、这一帧突然低于黑度阈值时才拒
|
|
115
|
+
- 最多连拒 2 帧,第 3 帧无论多黑都放行,避免卡死在黑帧上
|
|
116
|
+
- 暗色壁纸本来就一直暗,永远不会命中这条规则
|
|
117
|
+
|
|
118
|
+
WebGL 与 WebGPU 两条上传路径都加了这道闸。
|
|
119
|
+
|
|
120
|
+
## 玻璃本身
|
|
121
|
+
|
|
122
|
+
- **模糊**:13-tap 泊松核高斯。WebGL 端 1–4 次 ping-pong 把半径堆到最大;WebGPU 端是独立 WGSL 前置通道。`背景模糊` 拉满时是平滑的大半径过渡,不是被截断的 CSS blur。
|
|
123
|
+
- **遮挡窗口**:DSH 下面压着的浏览器、编辑器、播放器按屏幕坐标裁出来贴回玻璃背后,圆角与透明区按预乘 alpha 合成,不贴黑边。截图一次 0.02–0.06 s,可关。
|
|
124
|
+
- **文字**:按背景亮度在黑白之间切换,目标对比度 WCAG 7:1。手动选了颜色之后就不再自动改写。
|
|
125
|
+
- **光标**:取墨色的**反色**——深色字配白光标,浅色字配黑光标。CSS 只有 `caret-color` 可调,所以这是能做到的最稳妥方案。
|
|
126
|
+
- **五种颜色模式**:自动 / 浅色 / 深色 / 自定义 / 智能取色。智能取色从后方画面取主色染玻璃,按亮度阈值切深浅;切模式有 240 ms 过渡,你一拖滑块动画立刻让位。
|
|
127
|
+
- **按模块分开存**:每个背景模块各有自己的一份外观参数,每种颜色模式再各存一份,切来切去谁也不覆盖谁。
|
|
128
|
+
|
|
129
|
+
## 性能:先看档位,再开帧率
|
|
130
|
+
|
|
131
|
+
启动时静默读一次显卡字符串(`WEBGL_debug_renderer_info`,本地读、不上传),套用下表。
|
|
132
|
+
|
|
133
|
+
| 显卡 | 默认档 | 后端 | 帧率 | 动态降分辨率 |
|
|
134
|
+
| --- | --- | --- | --- | --- |
|
|
135
|
+
| Intel Iris Xe / UHD / HD、AMD Radeon / Vega APU、Apple M 系 | 🛡 核显保命 | WebGL | 30 | ✅ |
|
|
136
|
+
| 未知 / 虚拟机 / 软件渲染(SwiftShader、llvmpipe) | 🛡 核显保命 | WebGL | 30 | ✅ |
|
|
137
|
+
| GTX 10 / 16、RTX 20 / 30、RX 5000–7000、Arc A | ⚖ 独显均衡 | WebGL | 60 | ✅ |
|
|
138
|
+
| RTX 40 / 50、RX 9000、Arc B、RTX A | 🔥 火神狂暴 | WebGPU(回落 WebGL) | 144 | ❌ |
|
|
139
|
+
|
|
140
|
+
> 实测过的反面教材:i7-12700H + Iris Xe + 10 GB LPDDR5,解除帧率限制并关掉动态分辨率,连续 10 分钟后 GPU 96 °C,蓝屏。核显没有独立显存,超过 40 FPS 的每一帧只是在发热。
|
|
141
|
+
|
|
142
|
+
所以有五层保命:帧时间超预算 → 降分辨率(1.0 → 0.8 → 0.65 → 0.5)→ 关遮挡合成 → 静态半透明遮罩 → 自动关闭;连续 5 秒超预算或 `webglcontextlost` 直接回落安全档。
|
|
143
|
+
|
|
144
|
+
| 基线(i7-12700H / Iris Xe / 2520×1680@150%) | 数值 |
|
|
145
|
+
| --- | --- |
|
|
146
|
+
| 单帧渲染 1680×1119(scale 1.0) | 16.9 ms |
|
|
147
|
+
| 单帧渲染 1344×895(scale 0.8,默认) | ≈10–11 ms |
|
|
148
|
+
| 插件显存增量 | 20–25 MB |
|
|
149
|
+
| 捕获一帧(WGC + 合成 + JPEG) | ≈32 ms 均值(8 fps 上限) |
|
|
150
|
+
| 桌面静止时 | 零编码、零重绘 |
|
|
151
|
+
|
|
152
|
+
## 设置项速查
|
|
153
|
+
|
|
154
|
+
**外观**(每个模块各一份):背景模糊 10 px、饱和度 1.4、玻璃着色 55%、霜面浓度 34%(唯一控制厚度的滑条)、壁纸压暗 8%、液态流动 0.9(0 = 按需渲染)、文字颜色自动、颜色模式自动、自定义颜色 `#8ab4ff`、按壁纸自动深浅开。
|
|
155
|
+
|
|
156
|
+
**壁纸**:启用液态玻璃开、WE 库自动读取、对齐覆盖、位置 50/50、翻转关、速度 1.00×、音量 0、静音开、预设最多 24 条、本地文件支持图片 / 视频 / gif / apng。
|
|
157
|
+
|
|
158
|
+
**声音**:本机播放列表(mp3 / flac / wav / ogg / m4a / aac / opus,0.25–2.0×,音量可调),或系统音频(需授权,**只做分析,不二次播放**)。能量实时喂给 shader,低音落下时液面起伏。
|
|
159
|
+
|
|
160
|
+
**性能**:智能预设跟随显卡、后端 WebGL / WebGPU、最大帧率按档 30 / 60 / 144、自动降分辨率开、遮挡合成按档、壁纸刷新自动(8 fps 流 + 0.22 s digest + 420 ms 交叉淡入)。
|
|
161
|
+
|
|
162
|
+
## 已知边界
|
|
163
|
+
|
|
164
|
+
- 只映射主显示器。
|
|
165
|
+
- 被遮挡的 UWP / DRM / 最小化窗口可能是空表面:跳过不贴黑,但 `apps` 里仍会列出。
|
|
166
|
+
- 无边框捕获要 Windows 11 / 10 20348+;更老系统上系统黄框会回来,背景照常刷新。
|
|
167
|
+
- 窗口最小化时 Chromium 会停渲染循环,这是浏览器行为,也顺带省电。
|
|
168
|
+
- 场景 / 网页壁纸的切换依赖 WE 本体;WE 没装或没运行时这两类只给提示。
|
|
169
|
+
- 倍速 / 音量只作用于 `<video>` 类壁纸与动态图;场景壁纸的播放参数得进 WE 调。
|
|
170
|
+
- 非 Windows 平台没有遮挡合成,只能同步静态壁纸文件。
|
|
171
|
+
- elysia395 分支目前是占位:检测到就出现,接管与迁移还在做。
|
|
172
|
+
|
|
173
|
+
## 生态
|
|
174
|
+
|
|
175
|
+
- **Wallpaper Engine**(Steam AppID `431960`):库扫描、项目类型判断、属性语义都照它来;场景 / 网页靠它播放。
|
|
176
|
+
- **[elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine)**:第三种背景模块的兼容目标。装了两个可以共存,但同一时间只有一个在供背景。
|
|
177
|
+
|
|
178
|
+
## 开发
|
|
179
|
+
|
|
180
|
+
```powershell
|
|
181
|
+
pnpm build:client # client/src/*.js → client/client.js(只要 Node.js,无第三方依赖)
|
|
182
|
+
pnpm build:capture # tools/capture/lg-capture.cpp → bin/lg-capture.exe(要 clang++,可用 LG_CLANG 指定)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
| 路径 | 作用 |
|
|
186
|
+
| --- | --- |
|
|
187
|
+
| `index.js` | 宿主入口:`/liquid-glass/*` 路由(含 `/we/open`)、捕获调度、模块状态、更新检查 |
|
|
188
|
+
| `host/` | 壁纸识别、WE 桥(扫描 / 预览 / 切换)、常驻捕获助手、PowerShell 回退、更新检查 |
|
|
189
|
+
| `client/src/` | 前端源码,`01` → `14` 顺序拼接(13 = 壁纸中枢与颜色模式,14 = 音频矩阵) |
|
|
190
|
+
| `client/client.js` | 构建产物,DSH 通过 `exports["./client"]` 加载 |
|
|
191
|
+
| `tools/capture/lg-capture.cpp` | 原生捕获 / 合成助手(WGC + GDI+) |
|
|
192
|
+
| `bin/lg-capture.exe` | 预编译助手,随插件分发 |
|
|
193
|
+
| `docs/DETAIL.md` | 合成原理、屏幕空间映射、五层保命、着色器参数、模块数据形状 |
|
|
194
|
+
|
|
195
|
+
提 issue 请带上宿主 / 插件版本、系统、显卡、复现步骤和脱敏日志。
|
|
196
|
+
|
|
197
|
+
## 许可
|
|
198
|
+
|
|
199
|
+
[Apache License 2.0](LICENSE) © DSH Theme Engine contributors
|
|
200
|
+
|
|
201
|
+
允许商用、修改、再分发,需保留版权与许可声明;详见 [LICENSE](LICENSE) 与 [NOTICE](NOTICE)。
|
|
Binary file
|