DSH Desktop 啓動時使用 OS 分配的隨機端口(--port 0),導致瀏覽器源(origin)在每次重啓時變化。由於 localStorage 是按源分區的,由 dream-skin / liquid-glass 存儲的壁紙等視覺狀態會在每次重啓後丟失,即使它們從未被刪除。dsh-beauty-persist 將該視覺狀態移至服務器端 JSON 文件,使其獨立於端口。它在每次頁面加載時恢復狀態,並在 UI 調整設置時將更改推回服務器。
功能¶
- 持久化 dream-skin / liquid-glass 壁紙與主題。
- 服務端 JSON 文件存儲,不受端口變化影響。
- 支持 GIF 動圖壁紙。
- 支持 MP4 視頻壁紙。
- 全屏皮膚中心(上傳、預覽、應用、刪除素材)。
安裝與啓用¶
此插件適用於已經運行 dsh-dream-skin 和/或 dsh-liquid-glass 的配置文件(通常是 DSH Desktop 使用的 desktop 配置文件)。
1、進入桌面配置文件目錄:
cd ~/.dsh/profiles/desktop
2、添加依賴項(請將 <owner>/<repo> 替換爲實際的倉庫地址):
pnpm add dsh-beauty-persist@github:<owner>/<repo>
3、在 package.json 的 dsh.profile.bundles 中註冊 bundle:
{
"dsh.profile.bundles": [
"dsh-beauty-persist"
]
}
安裝完成後,需要重啓 DSH Desktop 以加載新的 bundle。
典型用法¶
重啓 DSH Desktop 後,無需額外配置。您可以通過以下方式管理壁紙:
1、在 GUI 設置中選擇壁紙或皮膚。選擇後,狀態會自動保存到服務器端,隨重啓恢復。
2、使用命令行上傳文件(需 Node.js 環境):
# 上傳 GIF 動圖壁紙
node scripts/set-gif-wallpaper.mjs "C:\path\to\my-wallpaper.gif"
# 上傳 MP4 視頻壁紙
node scripts/set-mp4-wallpaper.mjs "C:\path\to\my-wallpaper.mp4"
3、在皮膚中心操作。打開 設置 → 外觀,找到 🎨 皮膚中心。您可以上傳本地圖片/GIF/MP4 到素材庫(~/.dsh/beauty-persist-assets/),點擊縮略圖應用,或點擊 ✕ 刪除。
注意事項¶
- 前置依賴:需要已運行
dsh-dream-skin或dsh-liquid-glass。 - 環境要求:需要 Node.js >= 18。
- 文件存儲位置:
- 狀態文件:
~/.dsh/beauty-persist-state.json - GIF 壁紙:
~/.dsh/beauty-persist-wallpaper.gif - MP4 壁紙:
~/.dsh/beauty-persist-wallpaper.mp4(最大 50MB) - 素材庫:
~/.dsh/beauty-persist-assets/(最大 50MB)