Skip to content

Conversation

@clay-golem
Copy link

This should set the wallpaper across all spaces and displays for Sonoma and later.
It modifies a plist, so I’ve added logic to create a backup of the original file.
I’m not sure how this worked before Sonoma, and I don’t have a Mac to test it, so I’m simply checking the OS version and falling back to the old setter in the plugin if needed.
There’s also a defaults read 'com.apple.wallpaper' 'SonomaFirstRunMigrationPerformed' flag, which I believe is used by the wallpaper agent to migrate older wallpapers after upgrading to Sonoma. But again, I have no way to test this—so just in case, I treat its absence or a value not equal to 1 as if the OS is older than Sonoma.

@clay-golem
Copy link
Author

It'd probably be good to add some simple type checking. Something like:

[[ "$(file -b "$1")" =~ (JPEG|PNG|HEIF|BMP) ]]

Though I don't know the whole range of acceptable types.

@rgcr
Copy link
Owner

rgcr commented Jan 12, 2026

Thanks for the PR, we went with a simpler approach, after setting the wallpaper via osascript, we just clear the Spaces and Displays entries from the plist and restart WallpaperAgent.
This forces macOS to apply the wallpaper to all spaces without needing a template file.
Check the changes in commit 49036f0

@rgcr rgcr closed this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants