Home » Questions » Computers [ Ask a new question ]

How can I span wallpapers over two monitors in Mac OS X?

How can I span wallpapers over two monitors in Mac OS X?

Is there any way to get a single wide desktop wallpaper to span a dual monitor setup in OS X?

Asked by: Guest | Views: 362
Total answers/comments: 1
bert [Entry]

"Adding a follow up here so it ends up on the google indexes. I have a way to make this work for static and dynamic backgrounds using some open source tools
Prerequisites

You'll need Homebrew unless you're ready to do a lot of ./configure && make && make install
The base prereq: imagemagick >= 7.0.8-50 (i.e., brew install imagemagick)
For dynamic desktops you'll need Xcode (App Store), wallpapper, and jq (i.e., brew tap mczachurski/wallpapper && brew install wallpapper jq)

Steps: I'm using Catalina.heic and .tiff outputs for an example here but it can be any image format for inputs and output

Make a directory for your images -
mkdir -p ~/Library/Desktop\ Pictures/Catalina\ {Left,Right}

Extract the right and left images (left will be zero or even, and right will be odd) - convert /System/Library/Desktop\ Pictures/Catalina.heic -crop 2x1@ +repage ~/Library/Desktop\ Pictures/Catalina%d.tiff

If you're just wanting a static background you can skip to step 7 (left image will be Catalina0.<ext> and right will be Catalina1.<ext>)

We need to extract the azimuth and altitude from the original image (technically you could use mp4box but it's overkill) - cd ~/Library/Desktop\ Pictures; cat /System/Library/Desktop\ Pictures/Catalina.heic | grep -aoP '(?<=apple_desktop:solar="")[^""]+' | base64 -d | plutil -convert json -; cd -

If this command fails, you may need to install GNU Grep to handle the -P option. Install with brew install grep—it will be installed as ggrep by default.

We need to convert the output to something that wallpapper understands

Right:
cat ~/Library/Desktop\ Pictures/\<stdin\> | jq '.ap.d as $d|.ap.l as $l|.si|map({fileName:""Catalina\((.i*2)+1).tiff"",altitude:.a,azimuth:.z})|(.[$d][""isForDark""]=true)|(.[$l][""isForLight""]=true)|(.[0][""isPrimary""]=true)' > ~/Library/Desktop\ Pictures/right.json
Left:
cat ~/Library/Desktop\ Pictures/\<stdin\> | jq '.ap.d as $d|.ap.l as $l|.si|map({fileName:""Catalina\(.i*2).tiff"",altitude:.a,azimuth:.z})|(.[$d][""isForDark""]=true)|(.[$l][""isForLight""]=true)|(.[0][""isPrimary""]=true)' > ~/Library/Desktop\ Pictures/left.json

Now we can just get wallpapper to create the files we need: for side in Left Right; wallpapper -i ~/Library/Desktop\ Pictures/${side:l}.json -o ~/Library/Desktop\ Pictures/Catalina\ ${side}/Catalina.heic

Now just add the files as desktop backgrounds (open ~/Library/Desktop\ Pictures will open the directory in Finder.app for you)"