Open cjohnston1158 opened 7 years ago
I thought this was done by:
OSX_SCRIPT = '''tell application "System Events"
set desktopCount to count of desktops
repeat with desktopNumber from 1 to desktopCount
tell desktop desktopNumber
set picture to POSIX file "%s"
end tell
end repeat
end tell
''' % image
Which seems to do it to all desktops ... apparently not. Can you provide code for all desktops?
I can't, no. Maybe the original author of that change could?
Working on something similar here (getspace.py) – just found your repo, maybe we can cooperate on some things (will definitely be borrowing from your Linux functions after having had a comparable general idea).
With regards to this issue: that AppleScript bit is actually not really working as it used to. As you can see, – after reading this – we are using a sqilte cmd at the moment (although that uses killall Dock
, which is annoying if happening regularly).
Any other ideas/experiences?
Does killall Dock
have a noticeable impact?
@bharadwaj-raju yes, it does, though it is somewhat negligible (some GUI effects will be disturbed/reset system wide for a brief instance, but no saved stuff will be deleted as far is I know).
I am researching the behavior of the sqlite3 ~/Library/Application\ Support/Dock/desktoppicture.db "UPDATE data SET value='{}'" && killall Dock
-bit a little further, also because it is not reliable in a (changing) multi display environment.
Will let you know if I come up with something.
@jnshnz Then how does OS X do it through the GUI (which, I assume, causes no disturbance)?
Does Dock
have a --reload
or similar option? Or in AppleScript (imaginary: tell application Dock to reload settings
)
On OS X, running this will only change the wallpaper on the active desktop. Would be awesome to see it change the wallpaper on all desktops.