Add option to set the same color for all virtual desktops
Is it possible to add an option to set the same color for all virtual desktops? Thank you!
I am not really familiar with virtual desktop so what does the utility do right now, set the wallpaper for just one virtual desktop?
Yes, exactly, it needs to be moved in every virtual desktop.
But bear in mind that also the "Desktop & Screen Saver" utility from "System Preferences" must be moved in every Virtual Desktop in order to change the background, so I'm not exactly sure that this is something feasible.
It looks like it is not that easy even when you want to do it manually https://apple.stackexchange.com/questions/71070/how-to-change-desktop-wallpaper-for-all-virtual-desktops
I don't know if that is the answer you're looking for but if you've got more than one desktop open at all times, you simply have to close all desktops and create new ones. From what I can tell MacOS mirrors wallpaper settings from the first display to all newly created ones. So after changing the wallpaper for desktop 1 the remaining still keep the settings from before making the change if that makes sense.
I saw in plist file ~/Library/Preferences/com.apple.spaces.plist in array 'Space Properties' you can find the number of spaces and their names (some UUID generated names).
And in the SQLite database file ~/Library/Application Support/Dock/desktoppicture.db they seem to have done some database relations between the spaces and the paths to the pictures.
But here is maybe some more investigation needed to find out how all exactly works.
As a workaround I made a bash script, but that needs some preconditions done to work.
preconditions:
-
give Terminal app 'Accessibility' rights (for using the rights with app 'osascript' in terminal from a bash script). System Properties -> Security & Privacy -> Privacy -> Accessibility and add 'Terminal' via '+' and activate it.
-
assign keyboard shortcuts to switch between spaces. System Properties -> Keyboard -> Shortcuts -> Mission Control and here assign under 'Mission Control' at least the shortcuts for 'Switch to Desktop 1' to 'control+option+1' and 'Move right a space' to 'control+option+->' (right cursor key) as the batch script will use those two shortcuts.
-
Have ChangeMenuBarColor installed
Here the quick and dirty bash script:
#!/bin/bash
SPACES=`/usr/libexec/PlistBuddy -c "Print :SpacesDisplayConfiguration:Space\ Properties:" ~/Library/Preferences/com.apple.spaces.plist | grep name -c `
echo "Go to first space"
# go to first space control+option+1 (key code 18) and change menu bar
osascript -e 'tell application "System Events" to key code 18 using {control down, option down}'
mint run igorkulman/ChangeMenuBarColor SolidColor "#CCCCCC" --all-displays
for (( c=2; c<=$SPACES; c++ ))
do
echo "Go to next space $c"
# go to next space control+option+left_arrow (key code 124)
osascript -e 'tell application "System Events" to key code 124 using {control down, option down}'
mint run igorkulman/ChangeMenuBarColor SolidColor "#CCCCCC" --all-displays
done
echo "Go to first space"
# go to first space control+option+1 (key code 18)
osascript -e 'tell application "System Events" to key code 18 using {control down, option down}'
# clear old temp backgrounds from ChangeMenuBarColor (only those older then 2 minutes)
find ~/Library/Application\ Support/ChangeMenuBarColor -name '*.jpg' -mmin +2 -delete > /dev/null