Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

OS X change wallpaper on all desktops #34

Open
cjohnston1158 opened this issue Feb 17, 2017 · 6 comments
Open

OS X change wallpaper on all desktops #34

cjohnston1158 opened this issue Feb 17, 2017 · 6 comments

Comments

@cjohnston1158
Copy link

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.

@bharadwaj-raju
Copy link
Owner

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?

@cjohnston1158
Copy link
Author

cjohnston1158 commented Feb 18, 2017 via email

@jnshnz
Copy link

jnshnz commented Mar 14, 2017

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?

@bharadwaj-raju
Copy link
Owner

Does killall Dock have a noticeable impact?

@jnshnz
Copy link

jnshnz commented Mar 17, 2017

@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.

@bharadwaj-raju
Copy link
Owner

@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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants