feat: lock screen video wallpaper via Apple Aerial injection#79
feat: lock screen video wallpaper via Apple Aerial injection#79CagesThrottleUs wants to merge 20 commits intothusvill:SwiftUIfrom
Conversation
Introduces LockScreenAerialManager Obj-C singleton (Task 1 of 5): - isVideoCodecSupported: validates .mov always, .mp4 only for H.264/HEVC - updateUserSymlink: creates user-level symlink with no admin rights - writeIndexPlist / revertIndexPlist: patches com.apple.wallpaper Index.plist to select livewallpaper_custom_001 and saves previous state for rollback - performPrivilegedSetupWithVideoPath:completion: stub — implemented in Task 2 Wired into Xcode project (PBXBuildFile, PBXFileReference, group + Sources phase) and exposed to Swift via LiveWallpaper-Bridging-Header.h.
- Add nil guards to revertIndexPlist: to prevent crash on missing/changed plist keys - Log symlink creation errors in updateUserSymlink: instead of silently discarding - Move kEntriesJSON to its usage site (Task 2 comment area), remove top-level constant - Wrap debug NSLog in writeIndexPlist: with #ifdef DEBUG - Add GPL-3 license header to both LockScreenAerialManager.h and .mm
…Script Implements performPrivilegedSetupWithVideoPath:completion: in LockScreenAerialManager.mm. Writes a bash+Python3 temp script that creates the system symlink (lw_slot.mov) and idempotently patches entries.json, then runs it via NSAppleScript with administrator privileges. Calls updateUserSymlink: on success and always delivers the completion block on the main thread.
- Promote entries.json path to file-level kEntriesJSON constant - Use /tmp/lw_lockscreen_setup.sh instead of NSTemporaryDirectory() to avoid shell injection - Guard NSAppleScriptErrorNumber against nil with -1 fallback - Add python3 availability check in bash script body - Derive cachePath/cacheDir/sysSlot/sysDir from self.userCachePath and kSystemSlot to eliminate duplicate path strings
durSecs == 0.0 passes CMTIME_IS_VALID but makes fmod(x, 0) undefined. Wrap seek block in durSecs > 0.0 check.
…on unlock screenLocked: bypassed pauseAllPlayers, leaving playbackPaused=NO. resumeAllPlayers guards on that flag, causing video to stay frozen until the 0.5s checkAndUpdatePlaybackState dispatch fired.
…ndler - Guard _players.firstObject.currentItem before calling currentTime to avoid silent kCMTimeZero when players array is empty at lock time - Use seekToTime:completionHandler: so resumeAllPlayers and fade-in fire only after the seek timebase has settled, preventing stutter
- Guard against empty currentVideoPath before calling LockScreenAerialManager - Simplify subtitle display: remove no-op Optional() wrapper - Call writeIndexPlist on fast path so Index.plist activates the asset - Capture revertIndexPlist error and surface it to lockScreenVideoError
…, privilege level
|
It crashes when it call that [edit] Unfortunately I can't develop it because of my tight timetable , but I'll check and merge once you fix thoes errors |
|
@thusvill I am unfortunately not able to test it because of Apple ID issues - do you know of an alternate way for me to test it out locally, this would save time in development. |
…ssetsd restart writeIndexPlist crashed because NS_ASSUME_NONNULL_BEGIN made NSError** nonnull, causing Swift to bridge it as throws — passing nil was undefined. Fix: - Mark both writeIndexPlist/revertIndexPlist with NS_SWIFT_NOTHROW and _Nullable * _Nullable so Swift treats them as regular BOOL functions - Remove writeIndexPlist call from the enable flow (was fragile due to undocumented Index.plist key path that varies by macOS version) - Add `killall idleassetsd` to the privileged setup script so the daemon restarts and picks up the new entries.json entry automatically
Signed-off-by: CagesThrottleUs <manstein.felix@gmail.com>
I can't understand why you can create a new AppleID?? 🤔. |
|
I was able to get a system where I can test it out still fixing errors. |
…tart WallpaperAgent after Index.plist write
Oh Thats Great 😊 |
|
Hey — sorry for the noise on this issue. I spent a day trying to get lock screen video working and didn't fully crack it. Writing this up so the investigation isn't lost. What I was trying to do When the user presses Ctrl+Cmd+Q, play their chosen video on the lock screen immediately — not after 20 minutes of idle. Short version The file-replacement approach works perfectly when LiveWallpaper is quit. The problem is the running daemon calls How the lock screen video system works on Tahoe
What it plays is controlled by the What actually works Replace the This works reliably when LiveWallpaper is not running. Confirmed repeatedly. Why it breaks when LiveWallpaper is running
Things I tried that didn't work Screensaver idle time — Set Kill app on lock, restart on unlock — Guarding Hiding daemon windows on lock — Thought the daemon window (at Clearing Next steps for whoever picks this up The core problem is that # After killing the extension, see what files it touches when it restarts
touch /tmp/before && killall WallpaperAerialsExtension
sleep 3
find ~/Library/Application\ Support/com.apple.wallpaper -newer /tmp/before -type fOr watch it live: sudo fs_usage -w -f filesystem | grep -i "WallpaperAerials"Once you know which file the extension reads as its A longer shot worth checking: The guard in State of the branch Branch:
The Sorry for leaving this incomplete — hope it saves someone time. |
|
No, its my bad that i didn't help you. So according to your comment, what i understood is that Thank you for your support. |
Summary
system slot → user cache → video) so subsequent wallpaper changes require no admin access after the first setupHow it works
/Library/Application Support/com.apple.idleassetsd/Customer/4KSDR240FPS/lw_slot.movlivewallpaper_custom_001toentries.json(idempotent)updateUserSymlink:updates~/Library/Caches/com.thusvill.LiveWallpaper/lockscreen/current.movwithout any admin promptwriteIndexPlist:setsAllSpacesAndDisplays.Idle.Content.Choicesto select the custom asset as the active lock screenscreenLocked:snapshotsCMTime + CFAbsoluteTime;screenUnlocked:seeks viacompletionHandler:then fades windows inFiles changed
LockScreenAerialManager.h/.mmLiveWallpaper-Bridging-Header.hLiveWallpaper.xcodeproj/project.pbxprojwallpaperdaemon/daemon.mmContentView.swiftWallpaperEngine.mmen.lproj/Localizable.stringsREADME.mdTest plan
.movor.mp4wallpaper and enable Lock Screen Video 🔒 in Settingsls -la "/Library/Application Support/com.apple.idleassetsd/Customer/4KSDR240FPS/lw_slot.mov"andls -la ~/Library/Caches/com.thusvill.LiveWallpaper/lockscreen/current.mov🤖 Generated with Claude Code