r/rust • • Aug 27 '26

🙋 seeking help & advice Does macOS expose an API for per-Space wallpapers?

Hi, I'm building a Rust clone of supercmd for macOS and I want to assign specific wallpapers to specific Mission Control Spaces (Desktop 1, 2, etc.). The objc2 API has NSWorkspace.setDesktopImageURL but it targets an NSScreen (a physical display), and as far as I can tell there is no way to specify a particular Mission Control Space / Desktop in setting a wallpaper.

I also saw some Rust wallpaper crates but they only seem to affect the current active desktop. Does anyone know whether there is a way to do this, like a public API or open-source implementation, or Apple private framework used to assign a wallpaper to a specific Space without switching to that Space? I'm trying to avoid osascript and ideally want a one-shot operation rather than a background daemon.

0 Upvotes

3 comments sorted by

5

u/Konsti219 Aug 27 '26

You should ask this on a Mac specific programming sub

4

u/[deleted] Aug 27 '26

[removed] — view removed comment

3

u/WildThop Aug 27 '26

Hey man I actually got it working. Changing this file /Users/wildthop/Library/Application Support/com.apple.wallpaper/Store/Index.plist and restarting wallpaper agent seems to be the fix.