Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to set the same color for all virtual desktops #17

Open
aleeraser opened this issue Dec 4, 2020 · 6 comments
Open

Add option to set the same color for all virtual desktops #17

aleeraser opened this issue Dec 4, 2020 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@aleeraser
Copy link

Is it possible to add an option to set the same color for all virtual desktops? Thank you!

@igorkulman
Copy link
Owner

I am not really familiar with virtual desktop so what does the utility do right now, set the wallpaper for just one virtual desktop?

@igorkulman igorkulman added enhancement New feature or request good first issue Good for newcomers labels Dec 4, 2020
@aleeraser
Copy link
Author

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.

@igorkulman
Copy link
Owner

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

@igorkulman igorkulman added the help wanted Extra attention is needed label Dec 5, 2020
@Marsellus19
Copy link

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.

@Waitsnake
Copy link

Waitsnake commented May 28, 2022

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.

@Waitsnake
Copy link

Waitsnake commented May 28, 2022

As a workaround I made a bash script, but that needs some preconditions done to work.

preconditions:

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants