Modify "Show on all Spaces" wallpaper setting by shell on macos Sonoma
2
votes
1
answer
2503
views
In system settings, under Wallpaper, there is a new toggle option to "Show on all Spaces". I'm looking for a way to set this option via shell in terminal since when a new wallpaper is set the switch toggles back to false.
I've tried diffing defaults before and after toggling the switch to see if there is some setting I have access to there, but no luck. Also looking into osascript and I am able to set the desktop picture there, but I haven't found a way to toggle that setting from osascript.
Edit: here's one way to do it, but it's less than ideal. I'd like to be able to set it without launching the application!

tell application "System Events"
tell application "System Settings"
activate
end tell
delay 0.5
tell process "System Settings"
delay 0.5
click menu item "Wallpaper" of menu "View" of menu bar 1
delay 0.5
click checkbox "Show on all Spaces" of group 2 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Wallpaper"
end tell
delay 0.5
tell application "System Settings"
quit
end tell
end tell
Asked by Jared Wyce
(23 rep)
Oct 10, 2023, 10:50 PM
Last activity: Nov 21, 2023, 05:20 AM
Last activity: Nov 21, 2023, 05:20 AM