diff --git a/.github/CONTRIBUTING.en.md b/.github/CONTRIBUTING.en.md index a05e5f5..a89f71d 100644 --- a/.github/CONTRIBUTING.en.md +++ b/.github/CONTRIBUTING.en.md @@ -4,7 +4,7 @@ 中文 · English

-Thanks for contributing to Codex Dream Skin. The project loads external themes into the official Codex desktop app through loopback CDP. macOS and Windows have separate install, injection, and restore paths, so choose the target platform before changing files. +Thanks for contributing to Codex 动态壁纸. The project loads external themes into the official Codex desktop app through loopback CDP. macOS and Windows have separate install, injection, and restore paths, so choose the target platform before changing files. ## Before you start diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index fdc6609..4d84f12 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -4,7 +4,7 @@ 中文 · English

-感谢你为 Codex Dream Skin 提交改进。这个项目通过本机回环 CDP 给官方 Codex 桌面应用加载外部主题。macOS 和 Windows 有独立的安装、注入与恢复路径,请先确定改动属于哪个平台,再缩小范围。 +感谢你为 Codex 动态壁纸提交改进。这个项目通过本机回环 CDP 给官方 Codex 桌面应用加载外部主题。macOS 和 Windows 有独立的安装、注入与恢复路径,请先确定改动属于哪个平台,再缩小范围。 ## 开始之前 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c8ade0b..f98bcd6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -68,7 +68,7 @@ body: - type: input id: dream_skin_version attributes: - label: Dream Skin version / 皮肤工具版本 + label: Codex 动态壁纸 version / 工具版本 description: | macOS: `macos/VERSION` in the repo, or client ZIP release notes (e.g. 1.1.1). Windows: commit / download date if no version file. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 9ef8312..dead26a 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,5 +1,5 @@ name: "Feature request / 功能建议" -description: "Suggest an improvement for Codex Dream Skin / 为换肤工具提改进建议" +description: "Suggest an improvement for Codex 动态壁纸 / 为动态壁纸工具提改进建议" title: "[Feature]: " labels: ["enhancement", "needs-triage"] body: @@ -78,7 +78,7 @@ body: label: Scope check / 范围确认 description: This helps filter out-of-scope requests / 帮助过滤超出项目范围的请求 options: - - label: This is about theming / UX of Dream Skin, not API keys or model relays / 这是换肤或皮肤工具体验,不是 API / 中转配置 + - label: This is about theming / UX of Codex 动态壁纸, not API keys or model relays / 这是动态壁纸工具体验,不是 API / 中转配置 required: true - label: I am not asking to modify official Codex binaries / asar / 我不是在要求修改官方 Codex 二进制或 asar required: true diff --git a/README.en.md b/README.en.md index 84b5a53..b4a1a98 100644 --- a/README.en.md +++ b/README.en.md @@ -1,4 +1,4 @@ -

Codex Dream Skin

+

Codex 动态壁纸

Themes, image wallpapers, and live wallpapers for the Codex desktop app.
@@ -17,7 +17,7 @@

- Codex Dream Skin themes and live wallpapers + Codex 动态壁纸

@@ -32,7 +32,7 @@ Report an issue

-> Unofficial and not affiliated with OpenAI. Codex Dream Skin injects themes through loopback-only `127.0.0.1` CDP. It does not modify WindowsApps, `.app`, `app.asar`, or the official code signature. +> Unofficial and not affiliated with OpenAI. Codex 动态壁纸 injects themes through loopback-only `127.0.0.1` CDP. It does not modify WindowsApps, `.app`, `app.asar`, or the official code signature. ## Why use it @@ -46,10 +46,10 @@ ## Windows: start in 30 seconds 1. Download [`CodexDreamSkinManager.exe`](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases/latest/download/CodexDreamSkinManager.exe). -2. Run it and select a PNG, JPEG, WebP, MP4, or WebM from your wallpaper library. +2. Run it and choose **添加壁纸** to import a PNG, JPEG, WebP, MP4, or WebM wallpaper. 3. Click **应用到 Codex**. Use **启动 / 重新应用** if Codex needs the skin reapplied. -The manager is a self-contained single-file app with the tested Dream Skin engine and Node.js runtime embedded. End users do not need the .NET SDK, Node.js, or manual PowerShell commands. +The manager is a self-contained single-file app with the tested wallpaper engine and Node.js runtime embedded. End users do not need the .NET SDK, Node.js, or manual PowerShell commands. > Releases are currently unsigned, so Windows may show an unknown-publisher prompt. Download only from this repository's [Releases](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases) page and verify the companion `.sha256` file. @@ -94,7 +94,7 @@ Use the menu-bar Studio to import, save, and switch image themes. See [`macos/RE | Windows / shared theme | macOS dark theme | |---|---| -| ![Codex Dream Skin red-white sci-fi theme](docs/images/screenshot-demo-art.png) | ![Codex Dream Skin macOS dark theme](docs/images/screenshot-macos-home.png) | +| ![Codex 动态壁纸 red-white sci-fi theme](docs/images/screenshot-demo-art.png) | ![Codex 动态壁纸 macOS dark theme](docs/images/screenshot-macos-home.png) | See [`docs/showcase.en.md`](./docs/showcase.en.md) for more real screenshots, the character preset, and eight concept directions. @@ -103,7 +103,7 @@ See [`docs/showcase.en.md`](./docs/showcase.en.md) for more real screenshots, th ```text Local wallpaper / theme config ↓ -Dream Skin local theme store +Codex 动态壁纸 local theme store ↓ 127.0.0.1 loopback CDP ↓ @@ -162,7 +162,7 @@ No. It controls only the theme background inside Codex. The Windows manager can
Why can an official Codex update break a theme? -Dream Skin depends on the Codex renderer DOM and local CDP. Official updates can move those structures. **启动 / 重新应用** often fixes it; compatibility patches are published in this repository. +The wallpaper engine depends on the Codex renderer DOM and local CDP. Official updates can move those structures. **启动 / 重新应用** often fixes it; compatibility patches are published in this repository.
@@ -200,7 +200,7 @@ Thanks to [passion8.cc](https://passion8.cc/register?aff=TuPe) for sponsoring th ## Feedback and contributions - Announcements, theme sharing, and community help: [GitHub Discussions](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/discussions). -- Launch announcement: [Codex Dream Skin v1.0.0 is now available](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/discussions/5). +- Launch announcement: [Codex 动态壁纸 v1.0.0 is now available](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/discussions/5). - Use the [Bug / Feature issue templates](./.github/ISSUE_TEMPLATE/). - PRs should include the platform, reproduction or goal, validation command, and restore test. - Contribution guide: [中文](./.github/CONTRIBUTING.md) · [English](./.github/CONTRIBUTING.en.md) @@ -213,4 +213,4 @@ This repository is an enhanced derivative of [Fei-Away/Codex-Dream-Skin](https:/ --- -If Dream Skin makes Codex feel more like your own workspace, consider leaving a **Star** and sharing a screenshot of your theme. +If Codex 动态壁纸 makes Codex feel more like your own workspace, consider leaving a **Star** and sharing a screenshot of your theme. diff --git a/README.md b/README.md index a88ed65..1841193 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

Codex Dream Skin

+

Codex 动态壁纸

给 Codex 桌面端换上主题、静态壁纸和动态壁纸。
@@ -17,7 +17,7 @@

- Codex Dream Skin:Codex 桌面主题与动态壁纸 + Codex 动态壁纸

@@ -32,7 +32,7 @@ 反馈问题

-> 非 OpenAI 官方产品。Codex Dream Skin 通过仅绑定 `127.0.0.1` 的本机 CDP 注入主题,不修改 WindowsApps、`.app`、`app.asar` 或官方代码签名。 +> 非 OpenAI 官方产品。Codex 动态壁纸通过仅绑定 `127.0.0.1` 的本机 CDP 注入主题,不修改 WindowsApps、`.app`、`app.asar` 或官方代码签名。 ## 为什么用它 @@ -46,10 +46,10 @@ ## Windows:30 秒开始 1. 下载 [`CodexDreamSkinManager.exe`](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases/latest/download/CodexDreamSkinManager.exe)。 -2. 双击运行,在壁纸库选择 PNG、JPEG、WebP、MP4 或 WebM。 +2. 双击运行,点击「添加壁纸」导入 PNG、JPEG、WebP、MP4 或 WebM。 3. 点击「应用到 Codex」。需要时点击「启动 / 重新应用」。 -管理器是自包含的单文件程序,内置经过测试的 Dream Skin 引擎与 Node.js 运行时;最终用户不需要安装 .NET SDK、Node.js 或手动执行 PowerShell。 +管理器是自包含的单文件程序,内置经过测试的动态壁纸引擎与 Node.js 运行时;最终用户不需要安装 .NET SDK、Node.js 或手动执行 PowerShell。 > 当前发布版尚未进行代码签名,Windows 可能显示“未知发布者”。请只从本仓库的 [Releases](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases) 下载,并使用同页 `.sha256` 文件核对。 @@ -94,7 +94,7 @@ cd macos | Windows / 通用主题 | macOS 暗色主题 | |---|---| -| ![Codex Dream Skin 红白科幻主题](docs/images/screenshot-demo-art.png) | ![Codex Dream Skin macOS 暗色主题](docs/images/screenshot-macos-home.png) | +| ![Codex 动态壁纸红白科幻主题](docs/images/screenshot-demo-art.png) | ![Codex 动态壁纸 macOS 暗色主题](docs/images/screenshot-macos-home.png) | 更多实机截图、人物预设与八种概念方向见 [`docs/showcase.md`](./docs/showcase.md)。 @@ -103,7 +103,7 @@ cd macos ```text 本地壁纸 / 主题配置 ↓ -Codex Dream Skin 本地主题仓库 +Codex 动态壁纸本地主题仓库 ↓ 127.0.0.1 回环 CDP ↓ @@ -162,7 +162,7 @@ bash macos/tests/run-tests.sh
为什么 Codex 更新后主题可能失效? -Dream Skin 依赖 Codex 的 renderer DOM 和本机 CDP。官方更新可能调整结构;通常点击「启动 / 重新应用」即可恢复,兼容性修复会持续发布在本仓库。 +动态壁纸引擎依赖 Codex 的 renderer DOM 和本机 CDP。官方更新可能调整结构;通常点击「启动 / 重新应用」即可恢复,兼容性修复会持续发布在本仓库。
@@ -200,7 +200,7 @@ Dream Skin 依赖 Codex 的 renderer DOM 和本机 CDP。官方更新可能调 ## 反馈与贡献 - 公告、主题分享与使用交流:[GitHub Discussions](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/discussions)。 -- 首个版本公告:[Codex Dream Skin v1.0.0 正式发布](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/discussions/5)。 +- 首个版本公告:[Codex 动态壁纸 v1.0.0 正式发布](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/discussions/5)。 - 使用 [Bug / 功能 Issue 模板](./.github/ISSUE_TEMPLATE/) 提交问题。 - PR 请说明平台、复现或目标、验证命令与恢复测试。 - 贡献指南:[中文](./.github/CONTRIBUTING.md) · [English](./.github/CONTRIBUTING.en.md) @@ -213,4 +213,4 @@ Dream Skin 依赖 Codex 的 renderer DOM 和本机 CDP。官方更新可能调 --- -如果 Dream Skin 让你的 Codex 更像自己的工作空间,欢迎点一个 **Star**,也欢迎分享你的主题截图。 +如果 Codex 动态壁纸让你的工作空间更舒适,欢迎点一个 **Star**,也欢迎分享你的主题截图。 diff --git a/docs/PROJECT.md b/docs/PROJECT.md index 99f4407..d46bfa8 100644 --- a/docs/PROJECT.md +++ b/docs/PROJECT.md @@ -1,4 +1,4 @@ -# Codex Dream Skin · 项目记录 +# Codex 动态壁纸 · 项目记录 > 本地归档说明。面向维护者,不是用户安装手册。 > 仓库首页:[`../README.md`](../README.md)(中文)· [`../README.en.md`](../README.en.md)(English) @@ -8,7 +8,7 @@ ## 1. 它是什么 -**Codex Dream Skin** 是给 **OpenAI Codex 桌面端** 用的**外部主题 / 换肤**方案: +**Codex 动态壁纸**是给 **OpenAI Codex 桌面端**用的**外部主题 / 换肤**方案: - 本机 **CDP** 注入 CSS + 装饰 DOM - **不修改**官方 `.app` / `app.asar` / WindowsApps / 代码签名 diff --git a/docs/background-generation-prompts.md b/docs/background-generation-prompts.md index 354577c..06ef695 100644 --- a/docs/background-generation-prompts.md +++ b/docs/background-generation-prompts.md @@ -1,4 +1,4 @@ -# Codex Dream Skin 纯背景生图提示词 +# Codex 动态壁纸纯背景生图提示词 本文按 `docs/images/gallery/skin-01.jpg` ~ `skin-08.jpg` 的视觉方向,拆解为可直接生成的**纯背景图**提示词。 diff --git a/docs/images/social-preview.png b/docs/images/social-preview.png index 117eeeb..ee09095 100644 Binary files a/docs/images/social-preview.png and b/docs/images/social-preview.png differ diff --git a/docs/images/social-preview.svg b/docs/images/social-preview.svg index 011a0a9..a66b8d1 100644 --- a/docs/images/social-preview.svg +++ b/docs/images/social-preview.svg @@ -34,7 +34,7 @@ - CODEX DREAM SKIN + CODEX 动态壁纸 diff --git a/docs/promo-copy.md b/docs/promo-copy.md index f6820b3..a0856d7 100644 --- a/docs/promo-copy.md +++ b/docs/promo-copy.md @@ -71,7 +71,7 @@ https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases/latest/download/Cod 开源地址和 Windows 下载链接放在评论区 / 个人主页,也可以直接搜索: -`CCDawn Codex Dream Skin` +`CCDawn Codex 动态壁纸` #Codex #OpenAI #程序员桌面 #动态壁纸 #开源软件 #Windows软件 #效率工具 @@ -83,13 +83,13 @@ https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases/latest/download/Cod 1. 我做了一个 Codex 动态壁纸管理器,单文件 EXE 下载即用 2. 不改官方安装包,也能给 Codex 换主题和视频背景 -3. Codex Dream Skin:让写代码的窗口真正属于你 +3. Codex 动态壁纸:让写代码的窗口真正属于你 ### 正文 默认 Codex 很干净,但不一定像你的工作空间。 -**Codex Dream Skin** 是一个开源的 Codex 桌面主题与动态壁纸工具。它不是把假截图盖在窗口上:侧栏、任务、项目选择器和输入框仍然是原生控件,可以正常点击和输入。 +**Codex 动态壁纸**是一个开源的 Codex 桌面主题与动态壁纸工具。它不是把假截图盖在窗口上:侧栏、任务、项目选择器和输入框仍然是原生控件,可以正常点击和输入。 Windows 版本现在提供完整图形化管理器: @@ -111,7 +111,7 @@ https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases/latest/download/Cod ## 英文短版 -**Codex Dream Skin** adds interactive themes and live wallpapers to the Codex desktop app. +**Codex 动态壁纸** adds interactive themes and live wallpapers to the Codex desktop app. - Self-contained Windows manager - PNG, JPEG, WebP, MP4, and WebM diff --git a/docs/reference-background-prompt-guide.en.md b/docs/reference-background-prompt-guide.en.md index c5a6486..10c3457 100644 --- a/docs/reference-background-prompt-guide.en.md +++ b/docs/reference-background-prompt-guide.en.md @@ -1,4 +1,4 @@ -# Codex Dream Skin Reference Image Prompts +# Codex 动态壁纸 Reference Image Prompts This guide generates **wallpaper artwork only** for use beneath real Codex controls. The recommended master is `2560 × 1440`, 16:9. A screenshot, app mockup, sidebar, card, or composer is not a usable theme background. @@ -74,7 +74,7 @@ Names of specific real people (for example, “Arina Hashimoto”) must not be p Prompt text cannot replace the generator's size control. Select `2560 × 1440` in the generator UI or API as well. If that exact size is unavailable, generate the highest-quality 16:9 landscape output, crop it to 16:9, and then resize it to `2560 × 1440`. Do not stretch a non-16:9 image. -Dream Skin uses `cover`, so 16:10, 4:3, and ultrawide windows crop some source pixels. For a right-side portrait, use this theme metadata: +The wallpaper engine uses `cover`, so 16:10, 4:3, and ultrawide windows crop some source pixels. For a right-side portrait, use this theme metadata: ```json { diff --git a/docs/reference-background-prompt-guide.md b/docs/reference-background-prompt-guide.md index fa1e321..3cb8da5 100644 --- a/docs/reference-background-prompt-guide.md +++ b/docs/reference-background-prompt-guide.md @@ -1,4 +1,4 @@ -# Codex Dream Skin 参考图生图提示词 +# Codex 动态壁纸参考图生图提示词 这份文档只生成会铺在真实 Codex 控件下方的**纯背景图**。推荐母版为 `2560 × 1440`、16:9;效果图、窗口截图、侧栏、卡片和输入框都不是背景素材。 @@ -74,7 +74,7 @@ README 里的“效果图”不等于可以导入的背景。下面这些文件 提示词中的 `2560 × 1440` 不能替代生成器自己的尺寸设置。请在生成器界面或 API 参数中同时选择 `2560 × 1440`;不支持该尺寸时,先生成最高质量的 16:9 横图,再在导出工具中裁切为 16:9 并缩放到 `2560 × 1440`。不要把非 16:9 图片直接拉伸变形。 -Dream Skin 使用 `cover` 铺满窗口,因此 16:10、4:3 和超宽窗口必然会裁掉少量边缘。使用右侧人物构图时,建议主题配置为: +动态壁纸使用 `cover` 铺满窗口,因此 16:10、4:3 和超宽窗口必然会裁掉少量边缘。使用右侧人物构图时,建议主题配置为: ```json { diff --git a/docs/showcase.en.md b/docs/showcase.en.md index 7581a32..5e8ca50 100644 --- a/docs/showcase.en.md +++ b/docs/showcase.en.md @@ -1,4 +1,4 @@ -# Codex Dream Skin Showcase +# Codex 动态壁纸 Showcase [Project home](../README.en.md) · [中文](./showcase.md) @@ -6,22 +6,22 @@ This gallery collects tested themes and concept directions. The sidebar, cards, ## Real injected themes -### Dream Skin red-white sci-fi +### Red-white sci-fi

- Codex Dream Skin red-white sci-fi theme + Codex 动态壁纸 red-white sci-fi theme

### Windows immersive theme

- Codex Dream Skin Windows immersive theme + Codex 动态壁纸 Windows immersive theme

### macOS dark theme

- Codex Dream Skin macOS dark theme + Codex 动态壁纸 macOS dark theme

## Tested character preset: Arina Hashimoto diff --git a/docs/showcase.md b/docs/showcase.md index b90016c..5727eb1 100644 --- a/docs/showcase.md +++ b/docs/showcase.md @@ -1,4 +1,4 @@ -# Codex Dream Skin 效果展厅 +# Codex 动态壁纸效果展厅 [返回项目首页](../README.md) · [English](./showcase.en.md) @@ -6,22 +6,22 @@ ## 真实注入效果 -### Dream Skin 红白科幻 +### 红白科幻

- Codex Dream Skin 红白科幻真实注入效果 + Codex 动态壁纸红白科幻效果

### Windows 沉浸式主题

- Codex Dream Skin Windows 沉浸式主题 + Codex 动态壁纸 Windows 沉浸式主题

### macOS 暗色主题

- Codex Dream Skin macOS 暗色主题 + Codex 动态壁纸 macOS 暗色主题

## 实测人物预设:桥本有菜 diff --git a/macos/README.md b/macos/README.md index c5c3a8a..b439188 100644 --- a/macos/README.md +++ b/macos/README.md @@ -1,4 +1,4 @@ -# Codex Dream Skin Studio +# Codex 动态壁纸 Unofficial macOS theme studio for the **official Codex Desktop** app. diff --git a/windows/CHANGELOG.md b/windows/CHANGELOG.md index 301057a..07952d5 100644 --- a/windows/CHANGELOG.md +++ b/windows/CHANGELOG.md @@ -4,7 +4,9 @@ ### 新增 -- 新增自包含的 Windows 图形化 EXE 管理器,提供壁纸库浏览与预览、一键应用、透出调节、启动/暂停/恢复、托盘控制和可选开机启动;发布文件内置 Dream Skin 引擎与 Node.js,最终用户无需手动运行脚本。 +- 产品显示名称统一为「Codex 动态壁纸」;管理器新增多选「添加壁纸」、可操作空状态,并显示 Codex、壁纸服务和当前壁纸状态。 +- Windows 文档将普通用户的单文件 EXE 路径与开发者的源码脚本路径明确分开。 +- 新增自包含的 Windows 图形化 EXE 管理器,提供壁纸库浏览与预览、一键应用、透出调节、启动/暂停/恢复、托盘控制和可选开机启动;发布文件内置动态壁纸引擎与 Node.js,最终用户无需手动运行脚本。 - Windows 系统托盘新增「壁纸透出」滑杆;100% 时视频保持原始画面,整页主题蒙层降为零,并随当前主题持久化;拖动滑杆不会重新传输整段视频。 - Windows 主题仓库与托盘支持本地 MP4/WebM 动态壁纸;视频静音循环、页面隐藏时暂停,并可像图片主题一样保存和切换。 - 视频采用上限 128 MB、单块 512 KiB 的 CDP 分块传输,在 renderer 内组装为 Blob URL,避免把完整视频塞进 early bootstrap payload;换主题、暂停和清理时会释放播放器与 Blob URL。 diff --git a/windows/README.en.md b/windows/README.en.md index 9d86198..95410c1 100644 --- a/windows/README.en.md +++ b/windows/README.en.md @@ -1,21 +1,29 @@ -# Codex Dream Skin for Windows +# Codex 动态壁纸

中文 · English

-Codex Dream Skin loads an external theme into the official Codex Windows desktop app through loopback CDP. The native sidebar, project picker, task content, and composer remain interactive. The tool does not modify WindowsApps, `app.asar`, or the app signature. +Codex 动态壁纸 loads an external theme into the official Codex Windows desktop app through loopback CDP. The native sidebar, project picker, task content, and composer remain interactive. The tool does not modify WindowsApps, `app.asar`, or the app signature. -## Graphical EXE manager +## For users: download the EXE -`windows/app/CodexDreamSkin.Manager` is a complete Windows desktop manager. Its release artifact is a -self-contained, single-file `CodexDreamSkinManager.exe` with the tested Dream Skin engine and Node.js -runtime embedded, so end users do not need Node.js, the .NET SDK, or manual PowerShell commands. +1. Download [`CodexDreamSkinManager.exe`](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases/latest/download/CodexDreamSkinManager.exe). +2. Run it and choose **添加壁纸** to import an image or video. +3. Select a wallpaper and choose **应用到 Codex**. Use **启动 / 重新应用** when needed. + +The release is a self-contained, single-file app with the tested wallpaper engine and Node.js runtime embedded. End users do not need Node.js, the .NET SDK, manual PowerShell commands, or administrator access. + +> The current release is unsigned, so Windows may show an “Unknown publisher” warning. Download only from this repository’s Releases page and verify the published SHA256. + +## Manager features The manager browses and previews PNG, JPEG, WebP, MP4, and WebM libraries; starts, reapplies, pauses, -restores, and switches Dream Skin; controls wallpaper reveal; exposes tray actions; and offers optional +restores, and switches wallpapers; controls wallpaper reveal; exposes tray actions; and offers optional per-user startup. +## For developers: build and script install + Build it with: ```powershell @@ -26,15 +34,15 @@ The build runs the Windows regression suite, embeds a trusted local Node.js 22+ self-contained `win-x64` executable, and runs a post-publish self-test. Output is written to `windows/dist`. -## Requirements +### Source and script requirements - The official `OpenAI.Codex` app installed from Microsoft Store and registered for the current user. - Node.js 22 or newer, with `node.exe` available on `PATH`. - Windows PowerShell 5.1 or newer. -Run the installer after Codex has fully exited. Normal use does not require administrator access or ownership changes under WindowsApps. +These dependencies apply only to source scripts and local builds, not to the release EXE above. Run the installer after Codex has fully exited. -## Install +### Install from source Open PowerShell in the repository's `windows` directory and run: @@ -44,9 +52,9 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\install-dream- The installer validates the official Codex Store package and Node.js, saves a recoverable appearance baseline, and initializes the local theme store. By default it also creates these shortcuts: -- `Codex Dream Skin`: launch or reapply the skin. -- `Codex Dream Skin - Tray`: open the system tray theme controls. -- `Codex Dream Skin - Restore`: restore the stock appearance and close the saved CDP session. +- `Codex 动态壁纸`: launch or reapply the wallpaper. +- `Codex 动态壁纸 - 托盘控制`: open the system tray controls. +- `Codex 动态壁纸 - 恢复官方外观`: restore the stock appearance and close the saved CDP session. Pass `-Port` during installation to use a fixed custom port. Valid ports range from `1024` through `65535`. @@ -56,7 +64,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\install-dream- ## Launch and verify -The `Codex Dream Skin` shortcut is the recommended launcher. It asks for confirmation before restarting an open Codex window. +The `Codex 动态壁纸` shortcut is the recommended launcher. It asks for confirmation before restarting an open Codex window. Command-line launch: @@ -83,7 +91,7 @@ Next, use the generated screenshot to check horizontal overflow and text contras ## Change and save themes -Open `Codex Dream Skin - Tray` to: +Open `Codex 动态壁纸 - 托盘控制` to: - Import a PNG, JPEG, or WebP background, or an MP4/WebM animated wallpaper. - Adjust wallpaper reveal: at 100% the video stays at its original opacity while the full-window theme veil reaches zero; the value persists with the theme. @@ -104,7 +112,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\restore-dream- -RestoreBaseTheme -PromptRestart ``` -Add `-Uninstall` to also remove the shortcuts created by Dream Skin: +Add `-Uninstall` to also remove the shortcuts created by the wallpaper tool: ```powershell powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\restore-dream-skin.ps1 ` @@ -117,7 +125,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\restore-dream- | Purpose | Path | |---------|------| -| Dream Skin state root | `%LOCALAPPDATA%\CodexDreamSkin` | +| Wallpaper state root | `%LOCALAPPDATA%\CodexDreamSkin` | | Active theme | `%LOCALAPPDATA%\CodexDreamSkin\active-theme` | | Saved themes | `%LOCALAPPDATA%\CodexDreamSkin\themes` | | Imported image archive | `%LOCALAPPDATA%\CodexDreamSkin\images` | @@ -155,13 +163,13 @@ When `-Port` is omitted, the launcher searches for a free port beginning at `933 ### Verification cannot find a CDP endpoint -Launch Codex through the `Codex Dream Skin` shortcut, then run verification. A normal Codex launch does not open the debug session used by Dream Skin. +Launch Codex through the `Codex 动态壁纸` shortcut, then run verification. A normal Codex launch does not open the debug session used by the wallpaper engine. ### The skin stops working after a Codex update Run the installer and launch shortcut again. The scripts rediscover the currently registered Store package instead of trusting an executable path from an older app version. -Open the repository's [new issue page](https://github.com/Fei-Away/Codex-Dream-Skin/issues/new/choose) and choose the bug form when reporting a problem. Include the Windows version, Codex source, reproduction steps, and relevant log lines. Remove secrets, `auth.json`, relay tokens, and private conversation content. +Open the repository's [new issue page](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/issues/new/choose) and choose the bug form when reporting a problem. Include the Windows version, Codex source, reproduction steps, and relevant log lines. Remove secrets, `auth.json`, relay tokens, and private conversation content. ## Security boundaries diff --git a/windows/README.md b/windows/README.md index 5ce22b4..e7f2dd5 100644 --- a/windows/README.md +++ b/windows/README.md @@ -1,24 +1,32 @@ -# Codex Dream Skin for Windows +# Codex 动态壁纸

中文 · English

-Codex Dream Skin 通过本机回环 CDP 给官方 Codex Windows 桌面应用加载外部主题。它保留原生侧栏、项目选择、任务内容和输入框,不修改 WindowsApps、`app.asar` 或应用签名。 +Codex 动态壁纸通过本机回环 CDP 给官方 Codex Windows 桌面应用加载外部主题。它保留原生侧栏、项目选择、任务内容和输入框,不修改 WindowsApps、`app.asar` 或应用签名。 -## 图形化 EXE 管理器 +## 普通用户:下载 EXE -`windows/app/CodexDreamSkin.Manager` 提供完整的 Windows 图形化管理器。发布版是自包含的 -单文件 `CodexDreamSkinManager.exe`,内置经过验证的 Dream Skin 引擎和 Node.js 运行时;最终 -用户不需要安装 Node.js、.NET SDK 或手动运行 PowerShell。 +1. 下载 [`CodexDreamSkinManager.exe`](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/releases/latest/download/CodexDreamSkinManager.exe)。 +2. 双击运行,点击「添加壁纸」导入图片或视频。 +3. 选择壁纸并点击「应用到 Codex」;需要时点击「启动 / 重新应用」。 + +发布版是自包含的单文件程序,内置经过验证的动态壁纸引擎和 Node.js 运行时。普通用户不需要安装 Node.js、.NET SDK,也不需要手动运行 PowerShell。程序不需要管理员权限。 + +> 当前发布版尚未进行代码签名,Windows 可能显示“未知发布者”。请只从本仓库 Releases 下载,并核对同页 SHA256。 + +## 管理器功能 管理器支持: - 浏览、搜索并预览桌面壁纸库中的 PNG、JPEG、WebP、MP4 和 WebM。 -- 一键启动或重新应用 Dream Skin、切换壁纸、暂停/恢复以及还原官方外观。 +- 一键启动或重新应用动态壁纸、切换壁纸、暂停/恢复以及还原官方外观。 - 调整「壁纸透出」程度,100% 时视频保持原始画面且整页主题蒙层为零。 - 系统托盘控制和可选的当前用户开机启动。 +## 开发者:构建与脚本安装 + 开发者可使用下列命令构建单文件版本: ```powershell @@ -28,15 +36,15 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\app\build-manager.ps1 构建脚本会运行 Windows 回归测试、嵌入本机可信的 Node.js 22+ 运行时、发布自包含 `win-x64` EXE,并执行发布后自检。输出位于 `windows/dist`。 -## 运行要求 +### 源码与脚本运行要求 - 从 Microsoft Store 安装且已注册到当前用户的官方 `OpenAI.Codex` 应用。 - Node.js 22 或更高版本,`node.exe` 可从 `PATH` 找到。 - Windows PowerShell 5.1 或更高版本。 -安装脚本需要在 Codex 完全退出后运行。普通使用不需要管理员权限,也不需要接管 WindowsApps 目录。 +这些依赖只适用于源码脚本和本地构建,不适用于上面的发布版 EXE。安装脚本需要在 Codex 完全退出后运行。 -## 安装 +### 从源码安装 在 PowerShell 中进入仓库的 `windows` 目录,然后运行: @@ -46,9 +54,9 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\install-dream- 安装器会校验官方 Codex Store 包和 Node.js,保存可恢复的外观配置,并初始化本地主题仓库。默认还会创建这些快捷方式: -- `Codex Dream Skin`:启动或重新应用皮肤。 -- `Codex Dream Skin - Tray`:打开系统托盘主题控制。 -- `Codex Dream Skin - Restore`:恢复官方外观并关闭已保存的 CDP 会话。 +- `Codex 动态壁纸`:启动或重新应用壁纸。 +- `Codex 动态壁纸 - 托盘控制`:打开系统托盘控制。 +- `Codex 动态壁纸 - 恢复官方外观`:恢复官方外观并关闭已保存的 CDP 会话。 如需使用自定义端口,可以在安装时传入 `-Port`。端口范围必须是 `1024` 到 `65535`。 @@ -58,7 +66,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\install-dream- ## 启动与验证 -推荐从 `Codex Dream Skin` 快捷方式启动。它发现 Codex 已经运行时会先询问是否重启。 +推荐从 `Codex 动态壁纸` 快捷方式启动。它发现 Codex 已经运行时会先询问是否重启。 命令行启动: @@ -85,7 +93,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\verify-dream-s ## 更换和保存主题 -打开 `Codex Dream Skin - Tray` 后可以: +打开 `Codex 动态壁纸 - 托盘控制` 后可以: - 更换 PNG、JPEG、WebP 背景图,或 MP4、WebM 动态壁纸。 - 使用「壁纸透出」滑杆调整覆盖在壁纸上的主题面板:100% 时视频保持原始画面,整页主题蒙层为零;设置会随主题持久化。 @@ -106,7 +114,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\restore-dream- -RestoreBaseTheme -PromptRestart ``` -如需同时删除 Dream Skin 创建的快捷方式,再增加 `-Uninstall`: +如需同时删除动态壁纸工具创建的快捷方式,再增加 `-Uninstall`: ```powershell powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\restore-dream-skin.ps1 ` @@ -119,7 +127,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\scripts\restore-dream- | 用途 | 路径 | |------|------| -| Dream Skin 状态根目录 | `%LOCALAPPDATA%\CodexDreamSkin` | +| 动态壁纸状态根目录 | `%LOCALAPPDATA%\CodexDreamSkin` | | 当前主题 | `%LOCALAPPDATA%\CodexDreamSkin\active-theme` | | 已保存主题 | `%LOCALAPPDATA%\CodexDreamSkin\themes` | | 导入图片归档 | `%LOCALAPPDATA%\CodexDreamSkin\images` | @@ -157,13 +165,13 @@ Get-AppxPackage -Name OpenAI.Codex ### 验证找不到 CDP 端点 -通过 `Codex Dream Skin` 快捷方式启动 Codex,再运行验证脚本。普通 Codex 启动方式不会打开 Dream Skin 所需的调试会话。 +通过 `Codex 动态壁纸` 快捷方式启动 Codex,再运行验证脚本。普通 Codex 启动方式不会打开动态壁纸所需的调试会话。 ### Codex 更新后皮肤失效 重新运行安装器和启动快捷方式。脚本会重新发现当前注册的 Store 包,不依赖旧版本的可执行文件路径。 -提交问题时请从仓库的 [Issue 提交页](https://github.com/Fei-Away/Codex-Dream-Skin/issues/new/choose) 选择 Bug 模板,附上系统版本、Codex 来源、复现步骤和相关日志片段。请删除密钥、`auth.json`、中转 token 和私人对话内容。 +提交问题时请从仓库的 [Issue 提交页](https://github.com/CCDawn/Codex-Dream-Skin-Enhanced/issues/new/choose) 选择 Bug 模板,附上系统版本、Codex 来源、复现步骤和相关日志片段。请删除密钥、`auth.json`、中转 token 和私人对话内容。 ## 安全边界 diff --git a/windows/app/CodexDreamSkin.Manager/CodexDreamSkin.Manager.csproj b/windows/app/CodexDreamSkin.Manager/CodexDreamSkin.Manager.csproj index 0372e19..05c6537 100644 --- a/windows/app/CodexDreamSkin.Manager/CodexDreamSkin.Manager.csproj +++ b/windows/app/CodexDreamSkin.Manager/CodexDreamSkin.Manager.csproj @@ -10,7 +10,7 @@ CodexDreamSkinManager CodexDreamSkin.Manager 1.0.0 - Codex Dream Skin Manager + Codex 动态壁纸 One-click wallpaper manager for the official Codex Windows app. CCDawn Copyright © CCDawn diff --git a/windows/app/CodexDreamSkin.Manager/DreamSkinService.cs b/windows/app/CodexDreamSkin.Manager/DreamSkinService.cs index 38b48eb..3827c09 100644 --- a/windows/app/CodexDreamSkin.Manager/DreamSkinService.cs +++ b/windows/app/CodexDreamSkin.Manager/DreamSkinService.cs @@ -20,7 +20,7 @@ public async Task StartAsync(CancellationToken cancellationToken = default) _runtime.StartScript, new[] { "-Port", "9335", "-PromptRestart" }, cancellationToken); - result.ThrowIfFailed("启动 Dream Skin"); + result.ThrowIfFailed("启动 Codex 动态壁纸"); } public async Task ApplyWallpaperAsync(string path, CancellationToken cancellationToken = default) diff --git a/windows/app/CodexDreamSkin.Manager/MainForm.cs b/windows/app/CodexDreamSkin.Manager/MainForm.cs index 8ae07c8..81d10c2 100644 --- a/windows/app/CodexDreamSkin.Manager/MainForm.cs +++ b/windows/app/CodexDreamSkin.Manager/MainForm.cs @@ -10,6 +10,7 @@ namespace CodexDreamSkin.Manager; internal sealed class MainForm : Form { + private const string DisplayName = "Codex 动态壁纸"; private static readonly Color Canvas = Color.FromArgb(17, 19, 24); private static readonly Color Surface = Color.FromArgb(25, 28, 35); private static readonly Color SurfaceRaised = Color.FromArgb(34, 38, 47); @@ -37,6 +38,7 @@ internal sealed class MainForm : Form private readonly Label _statusLabel = new(); private readonly Panel _statusDot = new(); private readonly Button _startButton = new(); + private readonly Button _importButton = new(); private readonly Button _pauseButton = new(); private readonly Button _applyButton = new(); private readonly Button _restoreButton = new(); @@ -66,7 +68,7 @@ public MainForm(DreamSkinService service, SettingsStore settingsStore, bool mini _settings = settingsStore.Load(); Directory.CreateDirectory(_settings.LibraryPath); - Text = "Codex Dream Skin"; + Text = DisplayName; StartPosition = FormStartPosition.CenterScreen; MinimumSize = new Size(1060, 680); Size = new Size(1280, 800); @@ -128,30 +130,29 @@ private void BuildLayout() BackColor = Surface, Padding = new Padding(26, 14, 22, 12), }; - var brand = CreateLabel("Codex Dream Skin", 20f, FontStyle.Bold, TextPrimary); + var brand = CreateLabel(DisplayName, 20f, FontStyle.Bold, TextPrimary); brand.AutoSize = true; - brand.Location = new Point(26, 13); + brand.Location = new Point(26, 24); header.Controls.Add(brand); - var subtitle = CreateLabel("Codex 内部壁纸管理器", 9.5f, FontStyle.Regular, TextMuted); - subtitle.AutoSize = true; - subtitle.Location = new Point(28, 49); - header.Controls.Add(subtitle); _statusDot.Size = new Size(10, 10); _statusDot.BackColor = Warning; _statusDot.Anchor = AnchorStyles.Top | AnchorStyles.Right; - _statusDot.Location = new Point(header.Width - 322, 39); + _statusDot.Location = new Point(header.Width - 478, 39); header.Controls.Add(_statusDot); - _statusLabel.AutoSize = true; + _statusLabel.AutoSize = false; + _statusLabel.Size = new Size(280, 54); _statusLabel.ForeColor = TextMuted; _statusLabel.Anchor = AnchorStyles.Top | AnchorStyles.Right; - _statusLabel.Location = new Point(header.Width - 304, 34); - _statusLabel.Text = "正在读取状态"; + _statusLabel.Location = new Point(header.Width - 460, 17); + _statusLabel.TextAlign = ContentAlignment.MiddleLeft; + _statusLabel.Text = "正在读取状态\r\n当前壁纸:正在读取"; + _statusLabel.AccessibleName = "Codex 和动态壁纸运行状态"; header.Controls.Add(_statusLabel); header.Resize += (_, _) => { - _statusDot.Left = header.ClientSize.Width - 322; - _statusLabel.Left = header.ClientSize.Width - 304; + _statusDot.Left = header.ClientSize.Width - 478; + _statusLabel.Left = header.ClientSize.Width - 460; _startButton.Left = header.ClientSize.Width - _startButton.Width - 22; }; @@ -159,11 +160,11 @@ private void BuildLayout() _startButton.Size = new Size(150, 42); _startButton.Anchor = AnchorStyles.Top | AnchorStyles.Right; _startButton.Location = new Point(header.Width - 172, 23); - _startButton.AccessibleName = "启动或重新应用 Codex Dream Skin"; + _startButton.AccessibleName = "启动或重新应用 Codex 动态壁纸"; _startButton.Click += async (_, _) => await RunOperationAsync( - "正在启动 Codex Dream Skin…", + "正在启动 Codex 动态壁纸…", () => _service.StartAsync(_lifetime.Token), - "Dream Skin 已启动。"); + "Codex 动态壁纸已启动。"); header.Controls.Add(_startButton); var left = new Panel @@ -187,6 +188,14 @@ private void BuildLayout() left.Controls.Add(_libraryPathLabel); left.Controls.SetChildIndex(_libraryPathLabel, 0); + ConfigureButton(_importButton, "添加壁纸", true); + _importButton.Dock = DockStyle.Top; + _importButton.Height = 40; + _importButton.AccessibleName = "添加图片或视频壁纸"; + _importButton.Click += async (_, _) => await ImportWallpapersAsync(); + left.Controls.Add(_importButton); + left.Controls.SetChildIndex(_importButton, 0); + var chooseFolderButton = new Button(); ConfigureButton(chooseFolderButton, "更换壁纸库", false); chooseFolderButton.Dock = DockStyle.Top; @@ -438,7 +447,7 @@ private async Task ReloadLibraryAsync() token.ThrowIfCancellationRequested(); ClearLibraryCards(); _librarySummary.Text = items.Count == 0 - ? "没有找到支持的壁纸" + ? "暂无壁纸 · 点击左侧「添加壁纸」导入" : $"共 {items.Count} 个可直接使用的壁纸"; foreach (var item in items) @@ -632,7 +641,7 @@ await RunOperationAsync( private async Task RestoreAsync() { var answer = MessageBox.Show( - "这会停止 Dream Skin 并恢复 Codex 官方外观。Codex 可能需要重启一次。是否继续?", + "这会停止动态壁纸并恢复 Codex 官方外观。Codex 可能需要重启一次。是否继续?", "恢复官方外观", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, @@ -649,6 +658,90 @@ await RunOperationAsync( refreshLibrary: false); } + private async Task ImportWallpapersAsync() + { + using var dialog = new OpenFileDialog + { + Title = "添加壁纸", + Filter = "支持的壁纸|*.png;*.jpg;*.jpeg;*.webp;*.mp4;*.webm|" + + "图片壁纸|*.png;*.jpg;*.jpeg;*.webp|动态壁纸|*.mp4;*.webm", + InitialDirectory = _settings.LibraryPath, + Multiselect = true, + CheckFileExists = true, + RestoreDirectory = true, + }; + if (dialog.ShowDialog(this) != DialogResult.OK) + { + return; + } + + SetBusy(true); + ShowMessage($"正在添加 {dialog.FileNames.Length} 个壁纸…", false); + try + { + Directory.CreateDirectory(_settings.LibraryPath); + var added = 0; + foreach (var source in dialog.FileNames) + { + _lifetime.Token.ThrowIfCancellationRequested(); + var sourcePath = Path.GetFullPath(source); + if (!WallpaperCatalog.IsSupported(sourcePath)) + { + throw new InvalidOperationException( + $"不支持的壁纸格式:{Path.GetFileName(sourcePath)}"); + } + if ((File.GetAttributes(sourcePath) & FileAttributes.ReparsePoint) != 0) + { + throw new InvalidOperationException( + $"壁纸不能是符号链接或重解析点:{Path.GetFileName(sourcePath)}"); + } + if (IsInsideDirectory(sourcePath, _settings.LibraryPath)) + { + continue; + } + + var destination = GetAvailableDestination( + _settings.LibraryPath, + Path.GetFileName(sourcePath)); + await using var input = new FileStream( + sourcePath, + FileMode.Open, + FileAccess.Read, + FileShare.Read, + 1024 * 1024, + FileOptions.Asynchronous | FileOptions.SequentialScan); + await using var output = new FileStream( + destination, + FileMode.CreateNew, + FileAccess.Write, + FileShare.None, + 1024 * 1024, + FileOptions.Asynchronous | FileOptions.SequentialScan); + await input.CopyToAsync(output, _lifetime.Token); + await output.FlushAsync(_lifetime.Token); + added++; + } + + await ReloadLibraryAsync(); + ShowMessage( + added == 0 ? "所选壁纸已在当前壁纸库中。" : $"已添加 {added} 个壁纸。", + false); + } + catch (OperationCanceledException) when (_lifetime.IsCancellationRequested) + { + // App shutdown owns cancellation. + } + catch (Exception exception) + { + await ReloadLibraryAsync(); + ShowError(exception); + } + finally + { + SetBusy(false); + } + } + private async Task ChooseLibraryAsync() { using var dialog = new FolderBrowserDialog @@ -719,8 +812,14 @@ private void RefreshStatus() { var status = _service.GetStatus(); _pauseRequested = status.Paused; - _statusLabel.Text = status.Summary; - _statusDot.BackColor = status.Paused ? Warning : status.WatcherRunning ? Success : Warning; + _statusLabel.Text = $"{status.Summary}\r\n当前壁纸:{status.CurrentWallpaperLabel}"; + _statusDot.BackColor = status.Paused + ? Warning + : status.WatcherRunning + ? Success + : status.CodexRunning + ? Accent + : Warning; _pauseButton.Text = status.Paused ? "恢复皮肤" : "暂停皮肤"; _pauseButton.Enabled = !_busy && (status.WatcherRunning || status.Paused); if (!_revealSlider.Focused) @@ -728,7 +827,7 @@ private void RefreshStatus() _revealSlider.Value = Math.Clamp(status.RevealPercent, 0, 100); UpdateRevealLabel(); } - _trayIcon.Text = $"Codex Dream Skin · {status.Summary}"; + _trayIcon.Text = $"{DisplayName} · {status.Summary}"; } private void UpdateRevealLabel() @@ -742,6 +841,7 @@ private void SetBusy(bool busy) { _busy = busy; _startButton.Enabled = !busy; + _importButton.Enabled = !busy; _restoreButton.Enabled = !busy; _applyButton.Enabled = !busy && _selectedWallpaper is not null; _revealSlider.Enabled = !busy; @@ -760,7 +860,7 @@ private void ShowError(Exception exception) ShowMessage(exception.Message, true); MessageBox.Show( exception.Message, - "Codex Dream Skin", + DisplayName, MessageBoxButtons.OK, MessageBoxIcon.Error); } @@ -775,9 +875,9 @@ private NotifyIcon BuildTrayIcon() }; menu.Items.Add("打开壁纸管理器", null, (_, _) => ShowManager()); menu.Items.Add("启动 / 重新应用", null, async (_, _) => await RunOperationAsync( - "正在启动 Codex Dream Skin…", + "正在启动 Codex 动态壁纸…", () => _service.StartAsync(_lifetime.Token), - "Dream Skin 已启动。")); + "Codex 动态壁纸已启动。")); menu.Items.Add("暂停 / 恢复", null, async (_, _) => { var status = _service.GetStatus(); @@ -795,7 +895,7 @@ await RunOperationAsync( var tray = new NotifyIcon { Icon = _appIcon, - Text = "Codex Dream Skin", + Text = DisplayName, Visible = true, ContextMenuStrip = menu, }; @@ -821,7 +921,7 @@ private void OnFormClosing(object? sender, FormClosingEventArgs args) Hide(); _trayIcon.ShowBalloonTip( 1800, - "Codex Dream Skin", + DisplayName, "管理器仍在任务栏托盘运行。", ToolTipIcon.Info); } @@ -886,6 +986,35 @@ private static string CompactPath(string path) : path; } + private static bool IsInsideDirectory(string path, string directory) + { + var relative = Path.GetRelativePath(Path.GetFullPath(directory), Path.GetFullPath(path)); + return !Path.IsPathRooted(relative) && + !relative.Equals("..", StringComparison.Ordinal) && + !relative.StartsWith(".." + Path.DirectorySeparatorChar, StringComparison.Ordinal); + } + + private static string GetAvailableDestination(string directory, string fileName) + { + var destination = Path.Combine(directory, fileName); + if (!File.Exists(destination)) + { + return destination; + } + + var stem = Path.GetFileNameWithoutExtension(fileName); + var extension = Path.GetExtension(fileName); + for (var index = 2; index < 10_000; index++) + { + destination = Path.Combine(directory, $"{stem} ({index}){extension}"); + if (!File.Exists(destination)) + { + return destination; + } + } + throw new IOException($"无法为壁纸生成可用文件名:{fileName}"); + } + private static Icon CreateAppIcon() { using var bitmap = new Bitmap(64, 64); diff --git a/windows/app/CodexDreamSkin.Manager/Models.cs b/windows/app/CodexDreamSkin.Manager/Models.cs index 15e6903..6175c0f 100644 --- a/windows/app/CodexDreamSkin.Manager/Models.cs +++ b/windows/app/CodexDreamSkin.Manager/Models.cs @@ -33,10 +33,22 @@ internal sealed record DreamSkinStatus( int RevealPercent) { public string Summary => Paused - ? "皮肤已暂停" + ? CodexRunning + ? "Codex 已打开 · 壁纸已暂停" + : "Codex 未打开 · 壁纸已暂停" : WatcherRunning - ? "Codex 壁纸正在运行" - : "等待启动"; + ? CodexRunning + ? "Codex 已连接 · 壁纸运行中" + : "Codex 未打开 · 壁纸服务运行中" + : CodexRunning + ? "Codex 已打开 · 壁纸未启动" + : "Codex 未打开 · 壁纸未启动"; + + public string CurrentWallpaperLabel => !string.IsNullOrWhiteSpace(ActiveTheme) + ? ActiveTheme + : !string.IsNullOrWhiteSpace(MediaPath) + ? Path.GetFileNameWithoutExtension(MediaPath) + : "未设置"; } internal sealed class AppSettings diff --git a/windows/app/CodexDreamSkin.Manager/Program.cs b/windows/app/CodexDreamSkin.Manager/Program.cs index 444a836..88683cd 100644 --- a/windows/app/CodexDreamSkin.Manager/Program.cs +++ b/windows/app/CodexDreamSkin.Manager/Program.cs @@ -5,6 +5,7 @@ namespace CodexDreamSkin.Manager; internal static class Program { private const string MutexName = @"Local\CodexDreamSkin.Manager"; + private const string ProductName = "Codex 动态壁纸"; [STAThread] private static int Main(string[] args) @@ -13,8 +14,8 @@ private static int Main(string[] args) if (!createdNew && !args.Contains("--self-test", StringComparer.OrdinalIgnoreCase)) { MessageBox.Show( - "Codex Dream Skin Manager 已经在运行,请查看任务栏托盘。", - "Codex Dream Skin", + $"{ProductName}已经在运行,请查看任务栏托盘。", + ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); return 0; @@ -58,7 +59,7 @@ private static int Main(string[] args) MessageBox.Show( $"启动失败:{exception.Message}\r\n\r\n日志:{logPath}", - "Codex Dream Skin", + ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); return 1; diff --git a/windows/scripts/common-windows.ps1 b/windows/scripts/common-windows.ps1 index 5b37bee..a70c064 100644 --- a/windows/scripts/common-windows.ps1 +++ b/windows/scripts/common-windows.ps1 @@ -1,4 +1,4 @@ -. (Join-Path $PSScriptRoot 'config-utf8.ps1') +. (Join-Path $PSScriptRoot 'config-utf8.ps1') function Enter-DreamSkinOperationLock { $sid = [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value @@ -802,5 +802,5 @@ function Stop-DreamSkinCodex { function Confirm-DreamSkinRestart { param([string]$Message) $shell = New-Object -ComObject WScript.Shell - return $shell.Popup($Message, 0, 'Codex Dream Skin', 52) -eq 6 + return $shell.Popup($Message, 0, 'Codex 动态壁纸', 52) -eq 6 } diff --git a/windows/scripts/install-dream-skin.ps1 b/windows/scripts/install-dream-skin.ps1 index 659885c..b92240b 100644 --- a/windows/scripts/install-dream-skin.ps1 +++ b/windows/scripts/install-dream-skin.ps1 @@ -1,4 +1,4 @@ -[CmdletBinding()] +[CmdletBinding()] param( [int]$Port = 9335, [switch]$NoShortcuts @@ -55,15 +55,15 @@ try { $portArgument = if ($PortExplicit) { " -Port $Port" } else { '' } foreach ($folder in @($desktop, $startMenu)) { - $shortcut = $shell.CreateShortcut((Join-Path $folder 'Codex Dream Skin.lnk')) + $shortcut = $shell.CreateShortcut((Join-Path $folder 'Codex 动态壁纸.lnk')) $shortcut.TargetPath = $powershell $shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -File `"$startScript`"$portArgument -PromptRestart" $shortcut.WorkingDirectory = $engine.Root - $shortcut.Description = 'Launch the official Codex app with Codex Dream Skin' + $shortcut.Description = '启动 Codex 并应用动态壁纸' $shortcut.Save() } - $restore = $shell.CreateShortcut((Join-Path $desktop 'Codex Dream Skin - Restore.lnk')) + $restore = $shell.CreateShortcut((Join-Path $desktop 'Codex 动态壁纸 - 恢复官方外观.lnk')) $restore.TargetPath = $powershell $restore.Arguments = "-NoProfile -ExecutionPolicy Bypass -File `"$restoreScript`"$portArgument -RestoreBaseTheme -PromptRestart" $restore.WorkingDirectory = $engine.Root @@ -71,11 +71,11 @@ try { $restore.Save() foreach ($folder in @($desktop, $startMenu)) { - $tray = $shell.CreateShortcut((Join-Path $folder 'Codex Dream Skin - Tray.lnk')) + $tray = $shell.CreateShortcut((Join-Path $folder 'Codex 动态壁纸 - 托盘控制.lnk')) $tray.TargetPath = $powershell $tray.Arguments = "-NoProfile -STA -WindowStyle Hidden -ExecutionPolicy Bypass -File `"$trayScript`"$portArgument" $tray.WorkingDirectory = $engine.Root - $tray.Description = 'Open Codex Dream Skin status and theme controls in the system tray' + $tray.Description = '打开 Codex 动态壁纸托盘控制' $tray.Save() } Start-Process -FilePath $powershell -ArgumentList ` @@ -84,9 +84,9 @@ try { } if ($NoShortcuts) { - Write-Host "Codex Dream Skin base theme installed at $($engine.Root). Run $($engine.Start) to launch it." + Write-Host "Codex 动态壁纸已安装到 $($engine.Root)。运行 $($engine.Start) 即可启动。" } else { - Write-Host 'Codex Dream Skin installed. The launch shortcut asks before restarting an open Codex window.' + Write-Host 'Codex 动态壁纸已安装。启动快捷方式会在重启已打开的 Codex 前询问。' } } finally { Exit-DreamSkinOperationLock -Mutex $operationLock diff --git a/windows/scripts/restore-dream-skin.ps1 b/windows/scripts/restore-dream-skin.ps1 index 6c2d3e7..fe95441 100644 --- a/windows/scripts/restore-dream-skin.ps1 +++ b/windows/scripts/restore-dream-skin.ps1 @@ -1,4 +1,4 @@ -[CmdletBinding()] +[CmdletBinding()] param( [int]$Port = 9335, [switch]$Uninstall, @@ -93,9 +93,9 @@ try { $forceAuthorized = [bool]$ForceRestart if ($shouldCloseCodex -and $PromptRestart) { $restartMessage = if ($NoRelaunch) { - 'Restore will close Codex and remove Dream Skin plus its CDP session. Continue?' + '恢复将关闭 Codex,并移除动态壁纸及其 CDP 会话。是否继续?' } else { - 'Restore will close Codex, remove Dream Skin and its CDP session, then reopen the official app. Continue?' + '恢复将关闭 Codex,移除动态壁纸及其 CDP 会话,然后重新打开官方应用。是否继续?' } $forceAuthorized = Confirm-DreamSkinRestart -Message $restartMessage if (-not $forceAuthorized) { @@ -152,6 +152,11 @@ try { $desktop = [Environment]::GetFolderPath('Desktop') $startMenu = Join-Path $env:APPDATA 'Microsoft\Windows\Start Menu\Programs' @( + (Join-Path $desktop 'Codex 动态壁纸.lnk'), + (Join-Path $desktop 'Codex 动态壁纸 - 恢复官方外观.lnk'), + (Join-Path $desktop 'Codex 动态壁纸 - 托盘控制.lnk'), + (Join-Path $startMenu 'Codex 动态壁纸.lnk'), + (Join-Path $startMenu 'Codex 动态壁纸 - 托盘控制.lnk'), (Join-Path $desktop 'Codex Dream Skin.lnk'), (Join-Path $desktop 'Codex Dream Skin - Restore.lnk'), (Join-Path $desktop 'Codex Dream Skin - Tray.lnk'), @@ -177,7 +182,7 @@ try { throw $restoreError } - Write-Host 'Dream Skin restore actions completed; any saved CDP session was closed.' + Write-Host 'Codex 动态壁纸恢复操作已完成;保存的 CDP 会话已关闭。' } finally { Exit-DreamSkinOperationLock -Mutex $operationLock } diff --git a/windows/scripts/start-dream-skin.ps1 b/windows/scripts/start-dream-skin.ps1 index a1941fb..43d4af5 100644 --- a/windows/scripts/start-dream-skin.ps1 +++ b/windows/scripts/start-dream-skin.ps1 @@ -1,4 +1,4 @@ -[CmdletBinding()] +[CmdletBinding()] param( [int]$Port = 9335, [switch]$RestartExisting, @@ -86,9 +86,9 @@ try { if (-not $debugReady -and $codexProcesses.Count -gt 0) { $restartAuthorized = [bool]$RestartExisting if (-not $restartAuthorized -and $PromptRestart) { - $restartAuthorized = Confirm-DreamSkinRestart -Message 'Codex must restart once to enable Dream Skin. Unsaved input may be lost. Restart now?' + $restartAuthorized = Confirm-DreamSkinRestart -Message 'Codex 需要重启一次以启用动态壁纸,未保存的输入可能丢失。现在重启吗?' if (-not $restartAuthorized) { - Write-Host 'Dream Skin launch was cancelled; Codex was not changed.' + Write-Host 'Codex 动态壁纸启动已取消;Codex 未发生更改。' exit 0 } } @@ -282,7 +282,7 @@ try { throw $startupError } - Write-Host "Codex Dream Skin is active on verified loopback port $Port." + Write-Host "Codex 动态壁纸已在经过验证的本机端口 $Port 上运行。" } finally { if ($null -ne $operationLock) { Exit-DreamSkinOperationLock -Mutex $operationLock } } diff --git a/windows/scripts/tray-dream-skin.ps1 b/windows/scripts/tray-dream-skin.ps1 index afe72ba..5a5dbee 100644 --- a/windows/scripts/tray-dream-skin.ps1 +++ b/windows/scripts/tray-dream-skin.ps1 @@ -25,7 +25,7 @@ try { $notify = [System.Windows.Forms.NotifyIcon]::new() $notify.Icon = [System.Drawing.SystemIcons]::Application - $notify.Text = 'Codex Dream Skin' + $notify.Text = 'Codex 动态壁纸' $notify.Visible = $true $menu = [System.Windows.Forms.ContextMenuStrip]::new() $notify.ContextMenuStrip = $menu @@ -34,7 +34,7 @@ try { param([string]$Message) [void][System.Windows.Forms.MessageBox]::Show( $Message, - 'Codex Dream Skin', + 'Codex 动态壁纸', [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Error ) @@ -140,24 +140,24 @@ try { $null = Add-DreamSkinTrayItem -Items $menu.Items -Text $pauseText -Action $pauseAction $null = Add-DreamSkinTrayItem -Items $menu.Items -Text '更换背景图或视频' -Action { $dialog = [System.Windows.Forms.OpenFileDialog]::new() - $dialog.Title = '选择 Codex Dream Skin 背景图或视频' + $dialog.Title = '选择 Codex 动态壁纸图片或视频' $dialog.Filter = 'Wallpaper files|*.png;*.jpg;*.jpeg;*.webp;*.mp4;*.webm|Image files|*.png;*.jpg;*.jpeg;*.webp|Video files|*.mp4;*.webm|All files|*.*' $dialog.Multiselect = $false try { if ($dialog.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) { $null = Set-DreamSkinActiveTheme -ImagePath $dialog.FileName -Theme $null -StateRoot $StateRoot Set-DreamSkinPaused -Paused $false -StateRoot $StateRoot | Out-Null - $notify.ShowBalloonTip(1800, 'Codex Dream Skin', '背景素材已更新。', [System.Windows.Forms.ToolTipIcon]::Info) + $notify.ShowBalloonTip(1800, 'Codex 动态壁纸', '背景素材已更新。', [System.Windows.Forms.ToolTipIcon]::Info) } } finally { $dialog.Dispose() } } $null = Add-DreamSkinTrayItem -Items $menu.Items -Text '保存当前主题' -Action { - $name = [Microsoft.VisualBasic.Interaction]::InputBox('输入主题名称:', '保存 Codex Dream Skin 主题', '') + $name = [Microsoft.VisualBasic.Interaction]::InputBox('输入主题名称:', '保存 Codex 动态壁纸主题', '') if ($name.Trim()) { $saved = Save-DreamSkinCurrentTheme -Name $name -StateRoot $StateRoot - $notify.ShowBalloonTip(1800, 'Codex Dream Skin', "已保存:$($saved.Theme.name)", [System.Windows.Forms.ToolTipIcon]::Info) + $notify.ShowBalloonTip(1800, 'Codex 动态壁纸', "已保存:$($saved.Theme.name)", [System.Windows.Forms.ToolTipIcon]::Info) } } @@ -174,7 +174,7 @@ try { $savedAction = { $null = Use-DreamSkinSavedTheme -ThemeDirectory $savedPath -StateRoot $StateRoot Set-DreamSkinPaused -Paused $false -StateRoot $StateRoot | Out-Null - $notify.ShowBalloonTip(1800, 'Codex Dream Skin', "已应用:$savedName", [System.Windows.Forms.ToolTipIcon]::Info) + $notify.ShowBalloonTip(1800, 'Codex 动态壁纸', "已应用:$savedName", [System.Windows.Forms.ToolTipIcon]::Info) }.GetNewClosure() $null = Add-DreamSkinTrayItem -Items $savedMenu.DropDownItems -Text $savedName -Action $savedAction } diff --git a/windows/tests/run-tests.ps1 b/windows/tests/run-tests.ps1 index ba0ff82..cf239e2 100644 --- a/windows/tests/run-tests.ps1 +++ b/windows/tests/run-tests.ps1 @@ -129,7 +129,10 @@ try { '$trayScript = $engine.Tray', '$shortcut.WorkingDirectory = $engine.Root', '$restore.WorkingDirectory = $engine.Root', - '$tray.WorkingDirectory = $engine.Root' + '$tray.WorkingDirectory = $engine.Root', + 'Codex 动态壁纸.lnk', + 'Codex 动态壁纸 - 托盘控制.lnk', + 'Codex 动态壁纸 - 恢复官方外观.lnk' )) { if (-not $installSource.Contains($requiredShortcutBinding)) { throw "Installer shortcut still depends on its source checkout: $requiredShortcutBinding" @@ -820,6 +823,11 @@ try { Join-Path $Root 'app\CodexDreamSkin.Manager\MainForm.cs' ) foreach ($managerUiContract in @( + 'Codex 动态壁纸', + '添加壁纸', + 'Multiselect = true', + '当前壁纸:{status.CurrentWallpaperLabel}', + '暂无壁纸 · 点击左侧「添加壁纸」导入', '100% · 原始壁纸画面', '开机启动管理器', '退出管理器', @@ -829,6 +837,18 @@ try { throw "Graphical manager UI contract is missing: $managerUiContract" } } + $managerModelSource = Read-DreamSkinUtf8File -Path ( + Join-Path $Root 'app\CodexDreamSkin.Manager\Models.cs' + ) + foreach ($managerStatusContract in @( + 'Codex 已打开 · 壁纸未启动', + 'Codex 未打开 · 壁纸未启动', + 'CurrentWallpaperLabel' + )) { + if (-not $managerModelSource.Contains($managerStatusContract)) { + throw "Graphical manager status contract is missing: $managerStatusContract" + } + } $traySource = Read-DreamSkinUtf8File -Path (Join-Path $Root 'scripts\tray-dream-skin.ps1') foreach ($requiredTrayAction in @('System.Windows.Forms.NotifyIcon', 'System.Windows.Forms.TrackBar', '壁纸透出', '暂停皮肤', '更换背景图或视频', '*.mp4;*.webm', '已保存主题', '完全恢复 Codex')) { @@ -860,7 +880,7 @@ try { $stateReadIndex = $startSource.IndexOf('$previousState = Read-DreamSkinState', [System.StringComparison]::Ordinal) $restartPromptIndex = $startSource.IndexOf('$restartAuthorized = Confirm-DreamSkinRestart', [System.StringComparison]::Ordinal) $recordedStopIndex = $startSource.IndexOf('$recordedInjectorStopped = Stop-DreamSkinRecordedInjector', [System.StringComparison]::Ordinal) - $cancelIndex = $startSource.IndexOf("Write-Host 'Dream Skin launch was cancelled", [System.StringComparison]::Ordinal) + $cancelIndex = $startSource.IndexOf("Write-Host 'Codex 动态壁纸启动已取消", [System.StringComparison]::Ordinal) $pauseClearIndex = $startSource.IndexOf('Set-DreamSkinPaused -Paused $false', [System.StringComparison]::Ordinal) if ($stateReadIndex -lt 0 -or $pauseClearIndex -le $stateReadIndex -or ($restartPromptIndex -ge 0 -and $pauseClearIndex -le $restartPromptIndex) -or