[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-77930":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":13,"lastSyncTime":29,"discoverSource":30},77930,"phosphene","kageroumado\u002Fphosphene","kageroumado","A video wallpaper engine for macOS Tahoe",null,"Swift",749,21,2,6,0,1,17,264,9,8.03,"MIT License",false,"main",true,[],"2026-06-12 02:03:45","# Phosphene\n\nA video wallpaper engine for macOS Tahoe.\n\nPhosphene is a menu bar app + wallpaper extension that plays your own video files as the macOS desktop and lock-screen wallpaper. It plugs into the system's native wallpaper picker, so videos appear alongside Apple's built-in Aerials in **System Settings → Wallpaper**.\n\nIt is built on top of Apple's private `WallpaperExtensionKit` framework — the same one Apple's own Aerials use — which means playback runs out-of-process, survives app quits, and integrates with the OS-level lock-screen \u002F idle \u002F sleep lifecycle.\n\n> ⚠️ **Private framework.** Phosphene loads `WallpaperExtensionKit` via `dlopen` and uses Mirror-based runtime introspection to talk to its XPC types. Apple could change this at any major OS release. The project tracks macOS 26 (Tahoe).\n\n## Features\n\n- **Bring your own videos.** Import MP4 \u002F MOV \u002F any AVFoundation-readable file. They show up in the system wallpaper picker.\n- **Gapless looping.** Frame-accurate loops by offsetting PTS\u002FDTS across loop boundaries — no flush, no stutter.\n- **Multi-display + per-Space selections.** Different wallpapers per display, persisted by macOS.\n- **Power-aware playback.** A graduated `PlaybackPolicy` reduces work or pauses entirely based on thermal state, battery level, on-battery vs AC, Game Mode, and presentation mode (active \u002F locked \u002F idle).\n- **Smooth lock-screen ramp.** When *Only on Lock Screen* is enabled, the wallpaper eases in\u002Fout with a cubic curve as you lock and unlock, matching Apple's own Aerials behavior.\n- **Pause when occluded.** Detects when every display is fully covered by windows and pauses rendering until the desktop is visible again.\n- **Adaptive variants.** Optionally pre-render lower-resolution \u002F lower-fps variants of a video; the renderer swaps to the cheapest variant that satisfies the current policy at each loop boundary.\n- **Menu bar control.** Preview the current wallpaper, toggle pause, switch displays, configure behavior, launch at login.\n\n## Requirements\n\n- **macOS Tahoe (26.0+).** Phosphene depends on the Wallpaper extension point introduced in macOS 14 but uses Tahoe-only SwiftUI and `glassEffect()` APIs.\n- **Apple Silicon.** Targets `arm64-apple-macos26.0`.\n- **Xcode 17+** to build, with Swift 6 strict concurrency enabled.\n\n## Building\n\n```sh\ngit clone https:\u002F\u002Fgithub.com\u002Fkageroumado\u002Fphosphene.git\ncd phosphene\nopen Phosphene.xcodeproj\n```\n\nIn Xcode, select the **Phosphene** scheme and Run. The project uses synchronized filesystem groups, so adding\u002Fremoving files in `Phosphene\u002F` or `PhospheneExtension\u002F` requires no pbxproj edits.\n\nYou'll need to set a development team for code signing. The wallpaper extension is embedded into the app bundle and registered with the system when the app launches.\n\nFor a headless compile check without local signing identities:\n\n```sh\nxcodebuild -project Phosphene.xcodeproj -scheme Phosphene -configuration Debug \\\n  -destination 'generic\u002Fplatform=macOS' \\\n  CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY='' build\n```\n\nOn the default DerivedData path, the unsigned debug app is produced at:\n\n```text\n~\u002FLibrary\u002FDeveloper\u002FXcode\u002FDerivedData\u002FPhosphene-*\u002FBuild\u002FProducts\u002FDebug\u002FPhosphene.app\n```\n\nTo install that local debug build into Applications:\n\n```sh\nrm -rf \u002FApplications\u002FPhosphene.app\ncp -R ~\u002FLibrary\u002FDeveloper\u002FXcode\u002FDerivedData\u002FPhosphene-*\u002FBuild\u002FProducts\u002FDebug\u002FPhosphene.app \u002FApplications\u002F\n```\n\n### Using a video wallpaper\n\n1. Launch Phosphene. Use the menu bar icon to **Manage Library** and add one or more videos.\n2. Open **System Settings → Wallpaper**. Phosphene's videos appear under their own collection.\n3. Pick a video. macOS handles the actual wallpaper assignment — Phosphene's extension provides the frames.\n\n## Architecture\n\n```\n┌─────────────────────────┐         ┌──────────────────────────────┐\n│  Phosphene.app          │         │  PhospheneExtension.appex     │\n│  (menu bar UI)          │         │  (host: WallpaperAgent)       │\n│                         │         │                              │\n│  • Library management   │  Darwin │  • XPC handler                │\n│  • Per-video metadata   │ ──────▶ │  • AVSampleBufferDisplayLayer │\n│  • Optimization (HEVC)  │  notif. │  • Power \u002F thermal monitor    │\n│  • Preferences          │         │  • Snapshot generator         │\n└─────────────────────────┘         └──────────────────────────────┘\n                  │                              │\n                  └──────────────┬───────────────┘\n                                 ▼\n                  Shared App Group container\n                  (~\u002FLibrary\u002FGroup Containers\u002Fglass.kagerou.phosphene)\n                  • Video library + variants\n                  • WallpaperPrefs.plist\n                  • BMP snapshot cache\n```\n\n**App side** (`Phosphene\u002F`) — SwiftUI menu-bar app. Manages the on-disk video library, transcodes optional lower-resolution variants via `VideoOptimizationService`, exposes preferences, and posts a Darwin notification when the library changes.\n\n**Extension side** (`PhospheneExtension\u002F`) — runs inside the system `WallpaperAgent` process when a Phosphene wallpaper is active. Loads `WallpaperExtensionKit.framework` at runtime, registers as a wallpaper provider, and renders frames into a remote `CAContext` via `AVSampleBufferDisplayLayer`. It receives XPC `acquire` \u002F `update` \u002F `invalidate` \u002F `snapshot` calls from `WallpaperAgent` and routes presentation-mode changes through `PlaybackPolicy`.\n\n**`PlaybackPolicy`** is the single source of truth for playback behavior. Inputs (thermal state, battery, presentation mode, user pause, occlusion, etc.) collapse to one of `full \u002F reduced \u002F minimal \u002F paused`. The renderer applies the policy on every state change.\n\n**`VideoRenderer`** owns the decode pipeline. Instead of `AVPlayerLayer` — which silently fails inside a remote `CAContext` — it drives `AVSampleBufferDisplayLayer` manually: one `AVAssetReader` for the current loop, a preloaded one for the next, and a PTS offset that grows across loops to keep the timeline monotonically increasing. Result is glitch-free looping without flushing the renderer.\n\n## Quirks worth knowing\n\n- **`WallpaperSnapshotXPC` swizzle.** The system's snapshot encoder checks `type(of: coder) == NSXPCCoder.self`, but the real coder is a subclass. Without the runtime swizzle in `PhospheneExtension.swift`, snapshots silently encode to nothing and you get a grey lock screen during transitions.\n- **Mirror-based XPC parsing.** Apple's request types (`WallpaperCreationRequestXPC` etc.) aren't part of any public SDK header. The extension reads them via `Mirror` reflection. If Apple renames fields, expect surgical breakage.\n- **Variants are advisory.** A \"1080p@30\" variant won't be selected if Power-Monitor thinks we're on AC and idle — `PlaybackPolicy` always picks the highest tier that's still allowed.\n\n## License\n\n[MIT](LICENSE). Do whatever you want, no warranty.\n\n## Acknowledgements\n\nBuilt by [@kageroumado](https:\u002F\u002Fx.com\u002Fkageroumado). Phosphene was originally a commercial project; it's open-source now because the market for \"video wallpaper apps on macOS\" turned out to be more crowded than it looked.\n","Phosphene 是一款专为 macOS Tahoe 设计的视频壁纸引擎。它通过菜单栏应用和壁纸扩展，让用户能够将自定义的视频文件设置为桌面和锁屏壁纸，并且与系统原生壁纸选择器无缝集成。项目基于 Apple 的私有 `WallpaperExtensionKit` 框架构建，确保了视频播放的独立进程管理、跨应用重启的持续运行以及与操作系统级别的锁屏\u002F闲置\u002F睡眠生命周期的兼容性。Phosphene 支持无缝循环播放、多显示器及每空间独立壁纸设定、节能意识下的播放策略调整等功能，适用于希望个性化其 macOS 界面同时保持系统性能稳定的用户。需要注意的是，由于依赖于未公开的框架，软件功能可能随 macOS 主版本更新而变化。","2026-06-11 03:56:14","CREATED_QUERY"]