dsh-mpkg-wallpaper 3.1.6 → 3.2.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/README.en.md CHANGED
@@ -4,19 +4,27 @@
4
4
 
5
5
  [中文](README.md) | [English](README.en.md)
6
6
 
7
- A plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web UI (dsh web) that adds background wallpapers: **Wallpaper Engine `.mpkg` parsing, Steam Workshop raw folders, video/web/image wallpapers, a full-screen frosted blur suite, theme-color & glass appearance, a local wallpaper library, timed rotation and one-click updates**. Nearly every visual detail is adjustable.
7
+ A plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web UI (dsh web) that adds background wallpapers: **Wallpaper Engine `.mpkg` parsing, Steam Workshop raw folders, video/web/image wallpapers, time-of-day switching, a full-screen frosted blur suite, theme-color & glass appearance, a local wallpaper library, timed rotation and one-click updates**. Nearly every visual detail is adjustable.
8
8
 
9
- > **Scene wallpaper status**: Wallpaper Engine scene wallpapers (Live2D puppets + shaders + particles) are rendered by a proprietary engine and **cannot be fully adapted on the web** (see [Scene wallpaper adaptation](#scene-wallpaper-adaptation)). The plugin provides two partial solutions — **static-frame extraction** and **layer compositing** — and falls back to the official preview animation for the rest.
9
+ > **One-liner**: video/image/web wallpapers play directly; **time-variation wallpapers support multi-slot auto-switching + manual slot lock**; **some web wallpapers with built-in options (e.g. Live2D portraits — resolution/language/volume) are wired into the plugin settings page and can be edited in the collapsible "Adjustable options" area**; Scene wallpapers get static-frame extraction + layer compositing as partial solutions.
10
10
 
11
11
  ## Core Features
12
12
 
13
13
  **📦 Wallpaper sources (all supported)**
14
- - **Wallpaper Engine `.mpkg`**: parsed directly in the browser (nothing uploaded to third parties); video wallpapers play their embedded mp4 / video textures; scene wallpapers extract content from the container; **time-of-day switching** picks the asset matching the current system time; **adjustable options (read-only)** for reference in the WE app
14
+ - **Wallpaper Engine `.mpkg`**: parsed directly in the browser (nothing uploaded to third parties); video wallpapers play their embedded mp4 / video textures; scene wallpapers extract content from the container; **time-of-day switching** picks the slot matching the current system time
15
15
  - **Steam Workshop raw folders**: auto-discovers the WE install (registry + libraryfolders.vdf, non-default drives too) and lists `video / web / scene` types; you can also point the custom folder directly at the **workshop root** (`steamapps/workshop/content/431960`) — every subfolder is auto-detected as a wallpaper
16
16
  - **Video wallpapers**: `.mp4` plays directly (custom folder / Steam library / local file)
17
17
  - **Web wallpapers**: HTML wallpapers load in a sandboxed iframe (experimental, with **risk preflight**: auto-tagged "⚠heavy animation" / "🌐external", see [Web wallpapers](#web-wallpapers-experimental))
18
18
  - **Images / GIF / URLs**: local images (png/jpg/webp/gif) or image URLs (incl. data:image) as backgrounds
19
19
 
20
+ **⏰ Time-variation wallpapers**
21
+ - Supports WE **time-variation** wallpapers (projects with `morningtime / daytime / dusktime / nighttime / timevarying` properties and multiple timestamped video textures):
22
+ - **Auto-switch**: checks every 60s and swaps to the slot matching the current system time
23
+ - **Manual lock / slot override**: the settings page offers "Auto + morning / day / dusk / night" buttons — click a slot to pin that asset, click "Auto" to resume time-based switching
24
+ - **Lazy loading**: only the current slot's video texture is extracted (tens of MB peak); other slots are read on demand at switch time — **avoids importing all slots at once and crashing mobile browsers (OOM)**
25
+ - **No cross-wallpaper bleed**: switching between two time-variation wallpapers clears the previous wallpaper's slot cache, so clicking morning/day/dusk never shows the *other* wallpaper's footage
26
+ - Adapted via: video mpkg; scene.pkg parsed the "mpkg way" (scene.pkg is the same PKG container as mpkg — slots with embedded video textures auto-switch)
27
+
20
28
  **🌊 Full-screen frosted blur suite**
21
29
  - **Unified blur**: one slider controls the whole screen's wallpaper blur; sidebar fog thickness, chat-area follow and new-chat follow are independently adjustable
22
30
  - **UI blur (each with own toggle + amount)**: dialogs (generic center windows + chat input), settings panel, download/confirm popups, popovers (menus/dropdowns/tooltips), mask (full-screen dim), sidebar frost (auto-lifted while a dialog is open)
@@ -44,25 +52,45 @@ A plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harn
44
52
  **🔄 Updates**
45
53
  - "Check update" compares **versions** (semver) — un-pushed local changes don't false-positive; "Apply update" pulls the latest code from GitHub, restart to take effect
46
54
 
55
+ **💾 Backup & restore / settings persistence**
56
+ - The "Other" tab provides **backup & restore**: export appearance settings (Appearance / Unified blur / UI blur / Aqua / Other) to a **shareable JSON file**, import to restore — not the current wallpaper or scanned dirs
57
+ - **Settings persist to a host file**: besides localStorage, settings are written to `~/.dsh-mpkg-wallpaper/settings.json` — **survives port changes / browser-data clears** (following elysia395 v0.4.0)
58
+
47
59
  ## Supported Types & Status
48
60
 
49
61
  | Type | Web behavior | Notes |
50
62
  |---|---|---|
51
63
  | **mpkg (video)** | ✅ Full | embedded mp4 / video textures play directly |
52
- | **mpkg (scene)** | 🟡 Partial | static-frame / layer composite / preview animation (below) |
64
+ | **mpkg (scene)** | 🟡 Partial | static-frame / layer composite / preview animation (below); slots with video textures auto-switch |
65
+ | **Time-variation wallpaper** | ✅ Full | multi-slot auto-switch + manual lock, lazy loading to avoid OOM |
53
66
  | **Video (mp4/webm)** | ✅ Full | plays directly |
54
- | **Web (HTML)** | 🟡 Experimental | sandboxed iframe; heavy-animation wallpapers may freeze on low-end devices |
67
+ | **Web (HTML)** | 🟡 Experimental | sandboxed iframe; **web wallpapers with settings are wired into the plugin (below)** |
55
68
  | **Scene raw folder (scene.pkg)** | 🟡 Partial | same as mpkg scene |
56
69
  | **Application (.exe)** | ❌ Excluded | safety: never read/executed |
57
70
 
71
+ ## Adjustable options & web-wallpaper settings wiring
72
+
73
+ - **mpkg wallpapers**: the project's own **adjustable options** are shown **read-only** in the collapsible "Adjustable options" area (the browser shows pre-rendered assets; apply changes in the WE app).
74
+ - **Web wallpapers (some wired in — Live2D portraits)**: some web wallpapers (e.g. Blue Archive / Honkai Star Rail Live2D portraits, usually with a `loadJson.json` `SettingModel`) have built-in options — now **wired into the plugin settings page**, editable in the **same collapsible "Adjustable options" area**:
75
+ - **Resolution 2k / 4k / 8k** (reloads the wallpaper)
76
+ - **Language** (per wallpaper: 中文 / 日本語 / English / Tiếng Việt / Русский …)
77
+ - **BGM & voice volume** (live, no reload)
78
+ - **Show touch-area boxes / show text box** toggles
79
+ - Changes are written to the wallpaper iframe's same-origin localStorage (key = skeleton name), then the wallpaper reloads
80
+ - **Hide the wallpaper's own settings panel**: these web wallpapers show a "Settings" button + panel in the top-right of the wallpaper surface, which can't be interacted with — the plugin **auto-hides it** on iframe load, and you operate the options via the plugin page.
81
+ - **A few web wallpapers are still in progress**: web wallpapers relying on external SDKs / special interaction logic (e.g. some miHoYo event pages) haven't had their built-in options wired in yet; they load as-is.
82
+
83
+ > These editable web-wallpaper controls only appear after the plugin detects the wallpaper's `loadJson.json`; plain image/video web wallpapers or those without settings show nothing extra.
84
+
58
85
  ## Scene Wallpaper Adaptation
59
86
 
60
87
  **Bottom line: WE scene wallpapers cannot be fully reproduced on the web — this is an engine-level limit, not plugin laziness.** Scene wallpapers are rendered by a proprietary engine: Live2D-style **puppet rigs (binary .mdl)**, **shader effects** (water waves / particles) and **scripts** (music-player UIs, etc.). There is no official renderer for browsers, and the formats are undocumented (RePKG only reverse-engineered PKG/TEX; MDL rigs have no public spec; the open-source [we-layerd](https://github.com/Aromatic05/we-layerd) bundles the official renderer but is **Linux Wayland only**).
61
88
 
62
- The plugin offers two partial solutions (chosen automatically by scene content):
89
+ The plugin offers these partial solutions (chosen automatically by scene content):
63
90
 
64
91
  1. **Static-frame extraction**: parses `scene.pkg` (PKG container + LZ4 + TEX decode) and picks the main texture → **high-resolution static image** (photography/illustration scenes near-original quality; tested up to 7680×4320)
65
92
  2. **Layer compositing**: parses all `image` layers in `scene.json` (background + subject + layered character parts) and draws them **accurately composited** on a canvas using the source coordinates/sizes; time-variation scenes pick the frame for the current hour
93
+ 3. **Time-variation "mpkg way"**: `scene.pkg` is the same PKG container as mpkg — slots with embedded video textures can be parsed the mpkg way → multi-slot auto-switching (as above)
66
94
 
67
95
  **Not covered**: MDL puppet characters (the body is assembled from rig parts; the flat textures are nearly empty), shader wave/particle effects, scripted interactions. These fall back to the **official preview animation** (preview.gif).
68
96
 
@@ -70,21 +98,21 @@ The plugin offers two partial solutions (chosen automatically by scene content):
70
98
 
71
99
  ## Web Wallpapers (Experimental)
72
100
 
73
- - HTML wallpapers load full-screen in a **sandboxed iframe** (`allow-scripts` isolation; does not auto-reload after refresh — refresh the page to recover if frozen)
101
+ - HTML wallpapers load full-screen in a **sandboxed iframe** (`allow-scripts` isolation; **mute toggle, default on**; does not auto-reload after refresh — refresh the page to recover if frozen)
74
102
  - **Risk preflight**: auto-classified during scan; badges shown in the list and confirm dialog:
75
103
  - **⚠heavy animation**: Spine/L2D skeletal wallpapers — may freeze on low-end devices
76
104
  - **🌐external**: depends on external SDK/CDN (e.g. miHoYo event pages) — may fail to load
77
- - Tested: webm-video-based web wallpapers (light) work; Spine skeletal ones depend on device performance
105
+ - Tested: webm-video-based web wallpapers (light) work; Spine skeletal ones depend on device performance; **Live2D portraits with a `loadJson.json` are wired into the plugin options** (above)
78
106
 
79
107
  ## Settings Tabs
80
108
 
81
- - **Source**: master switch, hybrid, mpkg file, image/video files, custom folder (can point at the workshop root), local library (Steam scan), switching/rotation
109
+ - **Source**: master switch, hybrid, mpkg file, image/video files, custom folder (can point at the workshop root), local library (Steam scan), switching/rotation, **time-variation slot lock**
82
110
  - **Appearance**: theme color, flip, floating, frosted blur, lens zoom/position, brightness
83
111
  - **Unified blur**: full-screen blur + sidebar/title-bar fog, chat follow, new-chat follow
84
112
  - **UI blur**: dialog/settings/popup/popover/mask/sidebar frost each independent
85
113
  - **Wallpaper reveal**: sidebar/title-bar visibility, title-bar frost amount, sharpen
86
114
  - **Aqua**: unified fog / panel tint / adaptive text experiment toggles
87
- - **Other**: clock, update check/apply, reset defaults
115
+ - **Other**: clock, update check/apply, **backup & restore**, restore all defaults
88
116
 
89
117
  ## Installation
90
118
 
@@ -121,27 +149,28 @@ Uninstall: `dsh plugin --profile web remove dsh-mpkg-wallpaper`.
121
149
 
122
150
  ## Limitations
123
151
 
124
- - **Scene wallpapers cannot be fully dynamic on the web** (see [Scene wallpaper adaptation](#scene-wallpaper-adaptation)); adjustable options are read-only (apply changes in the WE app)
125
- - **Web wallpapers are experimental**: heavy animation / external dependencies may freeze or fail (preflight tags + refresh recovery)
152
+ - **Scene wallpapers cannot be fully dynamic on the web** (see [Scene wallpaper adaptation](#scene-wallpaper-adaptation)); mpkg adjustable options are read-only (apply changes in the WE app)
153
+ - **Web wallpapers are experimental**: heavy animation / external dependencies may freeze or fail (preflight tags + refresh recovery); **web wallpapers with built-in options are partly wired in — a few are still in progress**
126
154
  - **Huge assets** (pure-browser mode): standalone video >600MB, video textures >250MB, images >200MB unsupported; **hybrid mode** has no such limit
127
155
  - Scene static-frame / layer-composite **first extraction takes a few seconds** (longer for 8K textures); afterwards served from cache
128
156
 
129
- ## Screenshots
157
+ <!-- ## Screenshots
130
158
 
131
- ![Sidebar collapsed · new session](screenshots/dhsw1.jpg)
159
+ <!-- ![Sidebar collapsed · new session](screenshots/dhsw1.jpg) -->
132
160
 
133
- *The dynamic wallpaper fills the whole UI. Sidebar collapsed, chat box centered with frosted blur; the sidebar is fully transparent so the wallpaper shows through cleanly.*
161
+ <!-- *The dynamic wallpaper fills the whole UI. Sidebar collapsed, chat box centered with frosted blur; the sidebar is fully transparent so the wallpaper shows through cleanly.* -->
134
162
 
135
- ![Sidebar expanded](screenshots/dshw2.jpg)
163
+ <!-- ![Sidebar expanded](screenshots/dshw2.jpg) -->
136
164
 
137
- *After adjusting panel opacity and unified blur: most UI areas are opacity-adjustable, the sidebar is semi-transparent with the wallpaper faintly visible behind.*
165
+ <!-- *After adjusting panel opacity and unified blur: most UI areas are opacity-adjustable, the sidebar is semi-transparent with the wallpaper faintly visible behind.* -->
138
166
 
139
- ![Settings page](screenshots/dshw3.jpg)
167
+ <!-- ![Settings page](screenshots/dshw3.jpg) -->
140
168
 
141
- *The wallpaper settings page. Beyond the screenshot, nearly everything is adjustable: unified blur, UI blur (dialogs/panels/popups/popovers/mask/sidebar frost), lens zoom & pan, wallpaper flip, theme color, sidebar/title-bar visibility, sharpen, and scene layer compositing with time-frame switching.*
169
+ <!-- *The wallpaper settings page. Beyond the screenshot, nearly everything is adjustable: unified blur, UI blur (dialogs/panels/popups/popovers/mask/sidebar frost), lens zoom & pan, wallpaper flip, theme color, sidebar/title-bar visibility, sharpen, and scene layer compositing with time-frame switching.* -->
142
170
 
143
- Wallpapers in the screenshots are by Bilibili UP【-夜莺Night】: [author page](https://b23.tv/86CyaFw)
171
+ <!-- Wallpapers in the screenshots are by Bilibili UP【-夜莺Night】: [author page](https://b23.tv/86CyaFw) -->
144
172
 
173
+ -->
145
174
  ## Official Docs
146
175
 
147
176
  Wallpaper Engine official help site: [help.wallpaperengine.io](https://help.wallpaperengine.io). mpkg/tex/mdl are proprietary formats without official docs (format knowledge in this plugin comes from RePKG / lwe public reverse-engineering).
@@ -155,11 +184,11 @@ Please include:
155
184
 
156
185
  ## Security
157
186
 
158
- - **No outbound network requests**: the plugin never contacts external networks; the only network activity is user-entered image URLs and HTTP to the **local DSH host** (127.0.0.1)
187
+ - **No outbound network requests**: the plugin never contacts external networks; the only network activity is user-entered image URLs, resources loaded by web wallpapers themselves, and HTTP to the **local DSH host** (127.0.0.1)
159
188
  - **No secrets**: no paths, keys, tokens or personal info in the source
160
189
  - **Open-source deps only**: DSH's own react + official slots/locale APIs; the scene.pkg extractor is adopted from [elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine) (MIT, credited in the file header)
161
190
  - References: [dsh-bg-image](https://github.com/lyh9712/dsh-bg-image) (MIT, template), [unmpkg](https://github.com/aqnya/unmpkg) (GPL-3.0, mpkg format reference), [repkg](https://github.com/notscuffed/repkg) (GPL, .tex format research)
162
- - Data boundary: all parsing happens locally; localStorage only stores the background and settings
191
+ - Data boundary: all parsing happens locally; localStorage only stores the background and settings; settings are additionally stored at `~/.dsh-mpkg-wallpaper/settings.json`
163
192
 
164
193
  ## File Structure
165
194
 
@@ -168,8 +197,8 @@ dsh-mpkg-wallpaper/
168
197
  ├── package.json # dsh.bundle + dsh.client declarations
169
198
  ├── cordis.patch.yml # plugin install declaration
170
199
  ├── lib/
171
- │ ├── index.js # host: upload/streaming + Steam discovery + custom folders + scene routes
172
- │ ├── client.js # browser: mpkg parsing + settings page + bg DOM + blur suite + library
200
+ │ ├── index.js # host: upload/streaming + Steam discovery + custom folders + scene routes + settings persistence
201
+ │ ├── client.js # browser: mpkg parsing + settings page + bg DOM + blur suite + library + time-variation/web options
173
202
  │ └── pkg-extract.js# scene.pkg static-frame/layer extraction (PKG+LZ4+TEX, MIT, from elysia395)
174
203
  ├── tools/ # mpkg/tex/mdl reverse-engineering tools (for developers)
175
204
  ├── README.md # Chinese
@@ -179,11 +208,11 @@ dsh-mpkg-wallpaper/
179
208
  ## Acknowledgements
180
209
 
181
210
  - [Bil812](https://github.com/Bil812) — proposed wallpaper tint, adaptive text and unified full-screen mask in [PR #2](https://github.com/XHR666/dsh-mpkg-wallpaper/pull/2) and maintains a fork; those ideas were absorbed as the "Aqua" experiment mode (toggles, off by default)
182
- - [elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine) — the scene.pkg static-frame extractor (MIT); `lib/pkg-extract.js` is adopted from this project
211
+ - [elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine) — the scene.pkg static-frame extractor (MIT); `lib/pkg-extract.js` is adopted from this project; its "settings persist to host file" and "Edge canvas-compat rendering" ideas are also borrowed
183
212
  - [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) community — listing & promotion
184
213
 
185
214
  ## Rendering Feasibility Research
186
215
 
187
216
  - Full scenes (incl. Live2D puppets) can only be rendered by the proprietary engine: the WE app's native library (embedded Chromium + proprietary puppet renderer); the open-source [we-layerd](https://github.com/Aromatic05/we-layerd) (Rust) bundles the official renderer but is **Linux Wayland only**
188
217
  - There is no mature WE scene renderer for browsers (pixeltris/wallpaper-engine-web is gone) — **independent of OS, no browser can render Live2D scenes directly**; the official renderer .so is closed-source, so it cannot be compiled to WASM
189
- - This plugin's path: **static-frame extraction + layer compositing** (see [Scene wallpaper adaptation](#scene-wallpaper-adaptation)); for full dynamics use "render externally to video → video wallpaper"
218
+ - This plugin's path: **static-frame extraction + layer compositing + (time-variation) mpkg-way slot switching** (see [Scene wallpaper adaptation](#scene-wallpaper-adaptation)); for full dynamics use "render externally to video → video wallpaper"
package/README.md CHANGED
@@ -4,19 +4,27 @@
4
4
 
5
5
  [中文](README.md) | [English](README.en.md)
6
6
 
7
- 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web 界面(dsh web)添加背景壁纸的插件:**Wallpaper Engine `.mpkg` 解析、Steam 创意工坊原始目录、视频/网页/图片壁纸、整屏虚化体系、主题色与玻璃外观、本地壁纸库、定时轮换、一键更新**,几乎每一个外观细节都可以调节。
7
+ 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web 界面(dsh web)添加背景壁纸的插件:**Wallpaper Engine `.mpkg` 解析、Steam 创意工坊原始目录、视频/网页/图片壁纸、时间变化壁纸的多时段切换、整屏虚化体系、主题色与玻璃外观、本地壁纸库、定时轮换、一键更新**。几乎每一个外观细节都可以调节。
8
8
 
9
- > **场景(Scene)壁纸的现状**:Wallpaper Engine 的场景壁纸(Live2D 木偶 + shader + 粒子)由专有引擎渲染,**Web 端目前无法完整适配**(详见[场景壁纸适配现状](#场景壁纸scene适配现状))。插件提供**静态帧提取 + 图层合成**两个折中方案,其余回退官方预览动图。
9
+ > **一句话版本**:视频/图片/网页壁纸直接播放;**时间变化壁纸(Time Variation)支持多时段自动切换 + 手动锁定时段**;**带设置项的部分网页壁纸(如 Live2D 立绘类,含分辨率/语言/音量)已接入插件设置页,可在「可调参数」折叠区直接修改**;场景(Scene)壁纸提供静态帧提取 + 图层合成两个折中方案。
10
10
 
11
11
  ## 核心能力
12
12
 
13
13
  **📦 壁纸来源(全部支持)**
14
- - **Wallpaper Engine `.mpkg`**:浏览器内直接解析容器(不上传第三方);视频类自动播放内嵌 mp4 / 视频纹理;场景类解析容器提取素材;**多时段自动切换**(按系统时间选素材);**可调参数(只读展示)**供对照壁纸引擎 App
14
+ - **Wallpaper Engine `.mpkg`**:浏览器内直接解析容器(不上传第三方);视频类自动播放内嵌 mp4 / 视频纹理;场景类解析容器提取素材;**多时段自动切换**(按系统时间选时段素材)
15
15
  - **Steam 创意工坊原始目录**:自动发现 WE 安装(读注册表 + libraryfolders.vdf,支持非默认盘),列出 `video / web / scene` 三种类型;也可直接把 **workshop 主目录**(`steamapps/workshop/content/431960`)设为自定义目录——每个子文件夹自动识别为一张壁纸
16
16
  - **视频壁纸**:`.mp4` 直接播放(自定义目录 / Steam 库 / 本地文件均可)
17
17
  - **网页壁纸**:HTML 壁纸在沙箱 iframe 中加载(实验性,带**风险预检**:自动标注「⚠重动画」「🌐外网」,见[网页壁纸](#网页壁纸web实验性))
18
18
  - **图片 / GIF / URL**:本地图片(png/jpg/webp/gif)或图片链接(含 data:image)直接作背景
19
19
 
20
+ **⏰ 时间变化壁纸(Time Variation)**
21
+ - 支持 WE 的**时间变化**壁纸(项目里带 `morningtime / daytime / dusktime / nighttime / timevarying` 属性,含多个时段视频纹理):
22
+ - **自动切换**:按系统时间每 60 秒检查,跨时段自动换到对应素材
23
+ - **手动锁定 / 时段覆盖**:设置页提供「自动 + 清晨 / 白天 / 黄昏 / 夜晚」按钮——点击某个时段即固定为该素材,点击「自动」恢复随时间切换
24
+ - **按需懒加载**:只在当前时段提取视频纹理(单槽峰值约几十 MB),其余时段切换时才读取,**避免一次导入全部时段导致移动端 OOM 崩溃**
25
+ - **不串台**:切换不同时间变化壁纸时清空上一张的时段缓存,避免「点清晨/白天/黄昏却显示上一张壁纸画面」的串台问题
26
+ - 适配方式:视频类 mpkg、场景类(scene.pkg 用「mpkg 方式」解析——`scene.pkg` 与 mpkg 是同一 PKG 容器,含内嵌视频纹理的时段可自动切换)
27
+
20
28
  **🌊 整屏虚化(磨砂)体系**
21
29
  - **统一虚化**:一个条控制整屏壁纸模糊度;侧边栏白雾厚度、聊天区跟随、新会话按钮跟随独立可调
22
30
  - **界面虚化(各自独立开关+程度)**:对话框(通用居中窗口 + 聊天输入框)、设置面板、下载/确认弹窗、弹层(菜单/下拉/提示)、遮罩(全屏背景)、侧边栏磨砂(弹窗打开时自动摘除)
@@ -44,17 +52,36 @@
44
52
  **🔄 更新**
45
53
  - 「检查更新」按**版本号**对比(semver),本地未推送改动不误报;「一键更新」从 GitHub 拉最新代码写回,重启生效
46
54
 
55
+ **💾 备份与恢复 / 设置持久化**
56
+ - 「其他」tab 提供**备份与恢复**:导出外观类设置(外观 / 统一虚化 / 界面虚化 / Aqua / 其他)为**可分享的 JSON 文件**,导入即还原——不含当前壁纸与扫描目录
57
+ - **设置持久化到宿主端文件**:设置除浏览器 localStorage 外加存 `~/.dsh-mpkg-wallpaper/settings.json`,**换端口 / 清浏览器数据不丢失**(参考 elysia395 v0.4.0 的做法)
58
+
47
59
  ## 支持类型与现状
48
60
 
49
61
  | 类型 | Web 端表现 | 说明 |
50
62
  |---|---|---|
51
63
  | **mpkg(视频类)** | ✅ 完整 | 内嵌 mp4 / 视频纹理直接播放 |
52
- | **mpkg(场景类)** | 🟡 折中 | 静态帧提取 / 图层合成 / 预览动图(见下) |
64
+ | **mpkg(场景类)** | 🟡 折中 | 静态帧提取 / 图层合成 / 预览动图(见下);**含视频纹理时段的可自动切换** |
65
+ | **时间变化壁纸** | ✅ 完整 | 多时段自动切换 + 手动锁定,懒加载防 OOM |
53
66
  | **视频(mp4/webm)** | ✅ 完整 | 直接播放 |
54
- | **网页(HTML)** | 🟡 实验性 | iframe 沙箱加载;重动画壁纸在低性能设备可能卡顿 |
67
+ | **网页(HTML)** | 🟡 实验性 | iframe 沙箱加载;**带设置项的部分网页壁纸已接入插件可改(下)** |
55
68
  | **场景原始目录(scene.pkg)** | 🟡 折中 | 同 mpkg 场景类 |
56
69
  | **Application(exe)** | ❌ 排除 | 安全考虑,绝不读取/执行 |
57
70
 
71
+ ## 可调参数与网页壁纸的设置接入
72
+
73
+ - **mpkg 壁纸**:项目自带的**可调参数**在「可调参数」折叠区**只读展示**(浏览器显示的是预渲染素材,修改需在壁纸引擎 App 中生效),供对照。
74
+ - **网页壁纸(部分已接入,Live2D 立绘类)**:部分网页壁纸(如碧蓝档案 / 星穹铁道的 Live2D 立绘,通常含 `loadJson.json` 的 `SettingModel`)自带设置项,现在**已经接入插件设置页**——在**同一个「可调参数」折叠区**里可直接修改:
75
+ - **分辨率 2k / 4k / 8k**(重载生效)
76
+ - **语言**(按壁纸实际提供:中文 / 日本語 / English / Tiếng Việt / Русский 等)
77
+ - **背景音乐与语音音量**(实时生效,不重载)
78
+ - **显示触摸区域框 / 文本框**等开关
79
+ - 修改写入壁纸 iframe 的同源 localStorage(key = 骨架名),改完重载该壁纸生效
80
+ - **隐藏壁纸自带设置面板**:这类网页壁纸在壁纸表面右上角自带「设置」按钮 + 面板,且无法交互——插件在 iframe 加载后**自动隐藏**它(防挡住画面),设置通过插件页操作。
81
+ - **少部分网页壁纸仍在处理**:依赖外网 SDK / 特殊交互逻辑的网页壁纸(如部分米哈游事件页),其内置设置项尚未接入,仍按原样加载。
82
+
83
+ > 这类可改网页壁纸的按钮(分辨率/语言/音量等)只在识别到对应壁纸的 `loadJson.json` 后出现;普通图片/视频/无设置项的网页壁纸不显示。
84
+
58
85
  ## 场景壁纸(Scene)适配现状
59
86
 
60
87
  **结论先说:WE 场景壁纸无法在 Web 端完整还原,这是引擎层面的限制,不是插件偷懒。** 原因:场景由专有引擎渲染——Live2D 式**木偶骨架(.mdl 二进制)**、**shader 特效**(水波/粒子)、**脚本**(音乐播放器 UI 等)。浏览器没有官方渲染器,格式也未公开(RePKG 只逆向过 PKG/TEX,MDL 骨架无公开文档;开源方案 [we-layerd](https://github.com/Aromatic05/we-layerd) 打包了官方渲染器但仅限 Linux Wayland 桌面)。
@@ -63,28 +90,29 @@
63
90
 
64
91
  1. **静态帧提取**:解析 `scene.pkg`(PKG 容器 + LZ4 解压 + TEX 纹理解码),从场景图选取主纹理输出**高清静态图**(摄影/插画类场景可达原图画质,实测 7680×4320)
65
92
  2. **图层合成**:解析 `scene.json` 的全部 image 图层(背景 + 主体 + 分层角色部件),按源文件坐标/尺寸在 canvas 上**精确合成完整画面**(平铺图层类场景可完整还原构图;时间变化场景按当前时段选帧)
93
+ 3. **时间变化的 mpkg 方式**:`scene.pkg` 与 mpkg 是同一 PKG 容器,含内嵌视频纹理的时段可**按 mpkg 方式解析** → 多时段自动切换(同上述时间变化壁纸)
66
94
 
67
- **无法覆盖的**:MDL 木偶人物(角色的身体由骨架拼装,纹理层几乎为空)、shader 波浪/粒子特效、脚本交互。这些场景回退**官方预览动图**(preview.gif,作者生成的动画预览)。
95
+ **无法覆盖的**:MDL 木偶人物(人物的身体由骨架拼装,纹理层几乎为空)、shader 波浪/粒子特效、脚本交互。这些场景回退**官方预览动图**(preview.gif,作者生成的动画预览)。
68
96
 
69
97
  > 如果你需要场景壁纸的完整动态效果,现实路径:外部渲染成视频 → 用本插件的**视频壁纸**功能(Windows 用 WE 官方版录屏、Linux 用 we-layerd 录屏、移动端用壁纸引擎 App 录屏)。
70
98
 
71
99
  ## 网页壁纸(Web,实验性)
72
100
 
73
- - HTML 壁纸在**沙箱 iframe** 中全屏加载(`allow-scripts` 隔离,刷新后不自动重载——卡住时刷新页面即可恢复)
101
+ - HTML 壁纸在**沙箱 iframe** 中全屏加载(`allow-scripts` 隔离;有静音开关,默认开;刷新后不自动重载——卡住时刷新页面即可恢复)
74
102
  - **风险预检**:扫描时自动分类,列表与确认框标注:
75
103
  - **⚠重动画**:Spine/L2D 骨骼动画壁纸,低性能设备可能卡住界面
76
104
  - **🌐外网**:依赖外网 SDK/CDN(如米哈游事件页),加载可能失败
77
- - 实测:webm 视频类网页壁纸(轻量)正常;Spine 骨骼动画类视设备性能而定
105
+ - 实测:webm 视频类网页壁纸(轻量)正常;Spine 骨骼动画类视设备性能而定;**带 `loadJson.json` 设置项的 Live2D 立绘类已接入插件可改**(见上文)
78
106
 
79
107
  ## 设置分组(顶部 Tab)
80
108
 
81
- - **来源**:总开关、hybrid、mpkg 文件、图片/视频文件、自定义目录(可指 workshop 主目录)、本地壁纸库(Steam 扫描)、壁纸切换/轮换
109
+ - **来源**:总开关、hybrid、mpkg 文件、图片/视频文件、自定义目录(可指 workshop 主目录)、本地壁纸库(Steam 扫描)、壁纸切换/轮换、**时间变化壁纸的时段锁定**
82
110
  - **外观**:主题颜色、翻转、悬浮、磨砂模糊、镜头缩放/位置、亮度
83
111
  - **统一虚化**:整屏虚化 + 侧边栏/标题栏白雾、聊天区跟随、新会话跟随
84
112
  - **界面虚化**:对话框/设置面板/弹窗/弹层/遮罩/侧边栏磨砂各自独立
85
113
  - **透出壁纸**:侧边栏/标题栏透出、标题栏磨砂程度、锐化
86
114
  - **Aqua**:统一雾/面板取色/自适应文字等实验开关
87
- - **其他**:时钟、更新检查/热更新、恢复默认
115
+ - **其他**:时钟、更新检查/热更新、**备份与恢复**、恢复所有默认设置
88
116
 
89
117
  ## 安装
90
118
 
@@ -121,27 +149,28 @@ git clone https://github.com/XHR666/dsh-mpkg-wallpaper.git $DSH_HOME/profiles/no
121
149
 
122
150
  ## 限制
123
151
 
124
- - **场景壁纸无法完整动态还原**(见[场景壁纸适配现状](#场景壁纸scene适配现状));可调参数为只读展示,修改需在壁纸引擎 App 中生效
125
- - **网页壁纸为实验性**:重动画/外网依赖可能卡顿或加载失败(有预检标注与刷新恢复机制)
152
+ - **场景壁纸无法完整动态还原**(见[场景壁纸适配现状](#场景壁纸scene适配现状));mpkg 可调参数为只读展示,修改需在壁纸引擎 App 中生效
153
+ - **网页壁纸为实验性**:重动画/外网依赖可能卡顿或加载失败(有预检标注与刷新恢复机制);**自带设置项的部分网页壁纸已接入插件可改,少部分仍在处理**
126
154
  - **超大素材**(纯浏览器模式):独立视频 >600MB、视频纹理 >250MB、图片 >200MB 无法处理;**hybrid 模式**无此限制
127
155
  - 场景静态帧/图层合成的**首次提取耗时**(几秒,8K 纹理更久);之后走缓存秒开
128
156
 
129
- ## 截图演示
157
+ <!-- ## 截图演示
130
158
 
131
- ![侧边栏收起 · 新会话界面](screenshots/dhsw1.jpg)
159
+ <!-- ![侧边栏收起 · 新会话界面](screenshots/dhsw1.jpg) -->
132
160
 
133
- *动态壁纸铺满整个界面。此状态下侧边栏收起,聊天框位于屏幕中央并带有磨砂模糊效果;侧边栏呈全透明状态,壁纸完整透出,画面干净通透。*
161
+ <!-- *动态壁纸铺满整个界面。此状态下侧边栏收起,聊天框位于屏幕中央并带有磨砂模糊效果;侧边栏呈全透明状态,壁纸完整透出,画面干净通透。* -->
134
162
 
135
- ![侧边栏展开](screenshots/dshw2.jpg)
163
+ <!-- ![侧边栏展开](screenshots/dshw2.jpg) -->
136
164
 
137
- *通过「面板不透明度」与「统一虚化」滑条调节后的效果(图为调节后):大部分界面区域的不透明度均可调节,侧边栏半透明,壁纸在后方隐约透出。*
165
+ <!-- *通过「面板不透明度」与「统一虚化」滑条调节后的效果(图为调节后):大部分界面区域的不透明度均可调节,侧边栏半透明,壁纸在后方隐约透出。* -->
138
166
 
139
- ![设置页](screenshots/dshw3.jpg)
167
+ <!-- ![设置页](screenshots/dshw3.jpg) -->
140
168
 
141
- *壁纸引擎背景的设置界面。截图之外,外观几乎全部可调:统一虚化(独立分组)、界面虚化(对话框/设置面板/弹窗/弹层/遮罩/侧边栏磨砂)、镜头缩放与平移、壁纸翻转、主题颜色、侧边栏/标题栏透出壁纸、标题栏磨砂程度、轻度锐化,以及场景壁纸的图层合成与时间帧切换。*
169
+ <!-- *壁纸引擎背景的设置界面。截图之外,外观几乎全部可调:统一虚化(独立分组)、界面虚化(对话框/设置面板/弹窗/弹层/遮罩/侧边栏磨砂)、镜头缩放与平移、壁纸翻转、主题颜色、侧边栏/标题栏透出壁纸、标题栏磨砂程度、轻度锐化,以及场景壁纸的图层合成与时间帧切换。* -->
142
170
 
143
- 截图中的壁纸来自 B 站 UP 主【-夜莺Night】的壁纸作品:[作者主页](https://b23.tv/86CyaFw)
171
+ <!-- 截图中的壁纸来自 B 站 UP 主【-夜莺Night】的壁纸作品:[作者主页](https://b23.tv/86CyaFw) -->
144
172
 
173
+ -->
145
174
  ## 官方文档
146
175
 
147
176
  Wallpaper Engine 官方帮助站 [help.wallpaperengine.io](https://help.wallpaperengine.io);mpkg/tex/mdl 为专有格式,官方未公开文档(本插件格式知识来自 RePKG / lwe 公开逆向)。
@@ -155,11 +184,11 @@ Wallpaper Engine 官方帮助站 [help.wallpaperengine.io](https://help.wallpape
155
184
 
156
185
  ## 安全说明
157
186
 
158
- - **无对外网络请求**:插件不访问任何外部网络;唯一网络行为是用户手动输入的图片 URL 与**本机 DSH 宿主**(127.0.0.1)的 HTTP 通信
187
+ - **无对外网络请求**:插件不访问任何外部网络;唯一网络行为是用户手动输入的图片 URL、网页壁纸自身加载的资源与**本机 DSH 宿主**(127.0.0.1)的 HTTP 通信
159
188
  - **无敏感内容**:源码不含路径、密钥、令牌、个人信息
160
189
  - **开源依赖**:仅 DSH 自带 react + 官方 slots/locale 接口;scene.pkg 提取器采用 [elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine)(MIT,文件头已署名)
161
190
  - 参考项目:[dsh-bg-image](https://github.com/lyh9712/dsh-bg-image)(MIT,模板)、[unmpkg](https://github.com/aqnya/unmpkg)(GPL-3.0,仅参考 mpkg 二进制格式)、[repkg](https://github.com/notscuffed/repkg)(GPL,仅研究 .tex 格式)
162
- - 数据边界:所有解析在本机完成;localStorage 只存背景与参数
191
+ - 数据边界:所有解析在本机完成;localStorage 只存背景与参数;设置另存宿主端 `~/.dsh-mpkg-wallpaper/settings.json`
163
192
 
164
193
  ## 文件结构
165
194
 
@@ -168,8 +197,8 @@ dsh-mpkg-wallpaper/
168
197
  ├── package.json # dsh.bundle + dsh.client 声明
169
198
  ├── cordis.patch.yml # 插件安装声明(dsh plugin add 使用)
170
199
  ├── lib/
171
- │ ├── index.js # 宿主端:上传/流式播放 + Steam 发现 + 自定义目录 + 场景提取路由
172
- │ ├── client.js # 浏览器端:mpkg 解析 + 设置页 + 背景 DOM + 虚化体系 + 壁纸库
200
+ │ ├── index.js # 宿主端:上传/流式播放 + Steam 发现 + 自定义目录 + 场景提取路由 + 设置持久化
201
+ │ ├── client.js # 浏览器端:mpkg 解析 + 设置页 + 背景 DOM + 虚化体系 + 壁纸库 + 时间变化/网页设置
173
202
  │ └── pkg-extract.js# scene.pkg 静态帧/图层提取(PKG+LZ4+TEX,MIT,来自 elysia395)
174
203
  ├── tools/ # mpkg/tex/mdl 逆向解析工具(供开发者参考)
175
204
  ├── README.md # 本文件(中文)
@@ -179,11 +208,11 @@ dsh-mpkg-wallpaper/
179
208
  ## 致谢
180
209
 
181
210
  - [Bil812](https://github.com/Bil812) — 在 [PR #2](https://github.com/XHR666/dsh-mpkg-wallpaper/pull/2) 提出壁纸取色、自适应文字色、全屏统一遮罩等方案并维护 fork;其中思路已吸收为「Aqua 实验」模式(可开关,默认关)
182
- - [elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine) — scene.pkg 静态帧提取器(MIT),本插件 `lib/pkg-extract.js` 采用自该项目
211
+ - [elysia395/dsh-wallpaper-engine](https://github.com/elysia395/dsh-wallpaper-engine) — scene.pkg 静态帧提取器(MIT),本插件 `lib/pkg-extract.js` 采用自该项目;其「设置持久化到宿主端文件」「Edge canvas 兼容渲染」思路也已借鉴
183
212
  - [awesome-dsh-plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 社区 — 收录与推广
184
213
 
185
214
  ## 渲染可行性研究
186
215
 
187
216
  - 完整场景(含 Live2D 木偶)只能由专有渲染器完成:壁纸引擎 App 的原生库(内嵌 Chromium + 专有 puppet 渲染);开源方案 [we-layerd](https://github.com/Aromatic05/we-layerd)(Rust)打包了官方渲染器,但**仅限 Linux Wayland** 桌面
188
217
  - 浏览器端没有成熟的 WE 场景渲染器(pixeltris/wallpaper-engine-web 已消失)——**与操作系统无关,任何浏览器都无法直接渲染 Live2D 场景**;官方渲染器 .so 为闭源二进制,无源码无法编译成 WASM
189
- - 本插件的可行路径:**静态帧提取 + 图层合成**(见[场景壁纸适配现状](#场景壁纸scene适配现状));需要完整动态时用「外部渲染成视频 → 视频壁纸」方案
218
+ - 本插件的可行路径:**静态帧提取 + 图层合成 + (时间变化的)mpkg 方式时段切换**(见[场景壁纸适配现状](#场景壁纸scene适配现状));需要完整动态时用「外部渲染成视频 → 视频壁纸」方案