88

I have six virtual desktops and want to change a desktop wallpaper for all of them at once. There is no such option when using System Preferences, so I have to change a wallpaper only for one desktop and repeat this six times.

Is there any way for process automation?

5 Answers 5

55

Set the wallpaper for Desktop 1, delete all other desktops, then recreate them. New desktops created always share Desktop 1’s wallpaper.

1
  • 4
    No need to delete and recreate virtual desktops, just switch to each desktop one by one and change wallpaper on it thru  > System Preferences... > Desktop & Screen Saver
    – andrey
    Commented Jul 15, 2022 at 9:42
77
+100

From my comment on JDB's answer:

  1. Right-click on the Dock icon for System Preferences and select Options > [Assign To] All Desktops.
  2. Select your desired image for the current desktop from System Preferences.
  3. Keep the mouse pointer hovered over that image, and use the ctrl-arrow keyboard shortcut to quickly cycle through each desktop. As you arrive on each, click the mouse button to set that desktop.

You'll be done in about 5 seconds.

5
  • 1
    I tried this a couple weeks ago and it was very helpful. Thanks for the addition and you definitely deserve a share of "my" upvotes.
    – JDB
    Commented Mar 19, 2021 at 2:59
  • @JDBstillremembersMonica Well I do appreciate it, thank you!
    – Cai
    Commented Mar 19, 2021 at 8:35
  • 4
    Another quick tip if you don't want to assign the preferences window to all desktops, forcing it to always display on all desktops: you can click & hold on the Desktop & Screensaver window title bar, then press Ctrl-arrow (keeping the left mouse button pressed) to swap between desktops and the preferences window will follow your mouse cursor. Also a super handy tip for moving any arbitrary window between desktops.
    – Jordan
    Commented Jun 22, 2021 at 16:40
  • Clever solution
    – John White
    Commented Aug 3, 2023 at 20:11
  • Crazy how an OS famed for its UI can't just have a checkbox that says "put this background on all desktops". Thanks anyway! Commented Sep 28, 2023 at 13:55
64

Another option until Apple gives us a better one:

If, like me, you have your additional desktops arranged just how you like them, then the thought of deleting and recreating them just to change the wallpaper would be like recommending that I demolish my house so that I can repaint the walls. I'm not going to do that.

Instead, you can open up your Desktop preferences ( > System Preferences... > Desktop & Screen Saver ), then change the wallpaper on the current desktop.

Then, open Mission Control (on my machine, I launch Mission Control with the "Swipe up with three fingers" gesture) and drag & drop the Desktop & Screen Saver window onto the next desktop. The window will update to reflect the new desktop in focus and I can switch that desktop's image to whatever I want it to be. Repeat for as many desktops as you have. (If you have multiple monitors, then each monitor will have it's own Desktop window, named something like "Secondary Desktop".)

This is a lot easier than closing and reopening the desktop preferences on each desktop, and way easier than deleting and recreating all desktops (for me, at least).

2
  • 31
    For even more time-saving: you can right-click the Dock icon for System Preferences, select Options > [Assign To] All Desktops. Then as you Ctrl-arrow your way through your desktops the window stays there as you go. You can even leave the mouse pointer hovering over your preferred image.
    – Cai
    Commented Jul 12, 2019 at 15:00
  • 2
    @Cai Please convert your comment to an answer. It's a really good technique.
    – JS.
    Commented Mar 12, 2021 at 18:09
2

This might not be the answer you are looking for, but it is by far my favorite (requires Python3):

I have always used pywal on all of my Linux machines, and I just wanted to see if it would also work on MacOS, and indeed it does. Not only will it change the desktop image for all desktops with a single command, but it also has the ability to set your Terminal colors to a theme to match your desktop background (as long as you are using iTerm2 and not Terminal.app).

https://github.com/dylanaraps/pywal/

I would suggest cloning it from the git repo and building it from source, as there is an issue with the current version on PyPI that does not include a fix to show the cursor location in iTerm2.

If you think it would be easier to install it from PyPI and patch the file, that is also an option -- just run pip3 install pywal, and then find the location of sequences.py in your site-packages/pywal directory (mine happened to be at ~/Library/Python/3.9/lib/python/site-packages/pywal/sequences.py), and then just copy sequences.py from the master branch to your site-packages, and you are good to go.

My full installation went something like this:

$ pip3 install --user pywal
$ find /usr/local -type f -name "sequences.py"
(or)
$ find $HOME -type f -name "sequences.py"
> ./Library/Python/3.9/lib/python/site-packages/pywal/sequences.py
$ git clone https://github.com/dylanaraps/pywal
$ cp pywal/pywal/sequences.py ~/Library/Python/3.9/lib/python/site-packages/pywal/sequences.py

Then all you have to do to set the wallpaper for all desktops is run the following:

wal -i $HOME/Pictures/Wallpapers/your_image.jpg

...and bingo-bango it sets the wallpaper for ALL desktops AND gives you nice pretty matchy colors in iTerm2.

There are instructions in the pywal wiki on how to make the terminal colors persist across reboots by adding a line to ~/.bash_profile.

So all that being said, while this method may take a bit more time to set up, in the long run, I find it by far to be the easiest and most satisfying.

Also, just a heads-up: wal -i /path/to/image does not work for some images, and I'm not sure why, but it worked for most of the images I tested.

1
0

You can use my utility wally.

I read the code of the pywal in one of the answers and I recreated it in swift language along with a quick action to change wallpaper on all virtual desktops from the finder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .