The script set-desktop-catalina.sh
has been replaced by set-desktop.sh
.
Set a user's Desktop image in macOS 10.15 Catalina from the command line. See Limitations
- macos 10.14 Mojave (macOS 10.15 Catalina required for the examples below to work)
- Bash 3.2 (Catalina ships with 3.2.57)
- Python 2.7 (Catalina ships with 2.7.16)
An explanation of how Desktop images appear to be managed by macOS since Mojave (10.14) can be found at Setting the Desktop Image in macOS Mojave From the Command Line. While this article was written before the release of Catalina, the majority of the information is still relevant.
-
Download macos-desktop-main.zip
-
Double-click
~/Downloads/macos-desktop-main.zip
in the Finder to unzip it (Safari may do this automatically) -
Open the Terminal application in macOS
-
At a Terminal prompt:
-
type
cd ~/Downloads/macos-desktop-main
and press enter -
type
chmod +x set-desktop.sh options.py Catalina\ Tests/set-desktop-catalina-tests.sh
and press enter to make the scripts executable
-
-
See the Examples section for using the
set-desktop.sh
script -
See the Valid Options section for using the
options.py
script -
See the Tests section for using the
set-desktop-catalina-tests.sh
script
./set-desktop.sh IMAGE
IMAGE
can be either
- a pre-defined named option
- the path to an image file
See the Valid Options and Examples sections for more information.
These examples use the Apple-supplied Deskop pictures that could otherwise be set via System Preferences. They are categorised and listed as they appear in the Desktop & Screensaver pane as of macOS 10.15.7 Catalina.
See A Comparison of Apple-supplied Desktop Images Since macOS 10.14 Mojave
Setting the image to Dynamic (e.g. Catalina Dynamic) ensures it changes throughout the day, based on your location.
./set-desktop.sh catalina
./set-desktop.sh catalina-light
./set-desktop.sh catalina-dark
./set-desktop.sh mojave
./set-desktop.sh mojave-light
./set-desktop.sh mojave-dark
/set-desktop.sh solar
./set-desktop.sh catalina-day
./set-desktop.sh catalina-night
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Coast.heic"
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Evening.heic"
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Rock.heic"
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Shoreline.heic"
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Clouds.heic"
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Silhouette.heic"
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Sunset.heic"
./set-desktop.sh mojave-day
./set-desktop.sh mojave-night
./set-desktop.sh "/System/Library/Desktop Pictures/Desert 1.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Desert 2.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Desert 3.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Desert 4.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Desert 5.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Desert 6.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Desert 7.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/High Sierra.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Sierra.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Yosemite 3.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Sierra 2.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/El Capitan.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/El Capitan 2.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Yosemite.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Yosemite 4.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Flower 5.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Flower 6.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Flower 7.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Flower 8.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Flower 9.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Flower 10.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Reflection 1.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Reflection 2.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Reflection 3.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Reflection 4.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Abstract 1.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Abstract 2.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Abstract 3.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Abstract 4.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Ink Cloud.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Color Burst 3.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Color Burst 2.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Color Burst 1.jpg"
./set-desktop.sh "/System/Library/Desktop Pictures/Light Stream Red.heic"
./set-desktop.sh "/System/Library/Desktop Pictures/Light Stream Blue.heic"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Black.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Turquoise Green.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Cyan.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Blue Violet.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Yellow.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Plum.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Soft Pink.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Red Orange.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Ocher.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Dusty Rose.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Electric Blue.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Teal.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Stone.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Silver.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Space Gray.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Space Gray Pro.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Gold.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Gold 2.png"
./set-desktop.sh "/System/Library/Desktop Pictures/Solid Colors/Rose Gold.png"
./set-desktop.sh default
./set-desktop.sh "/path/to/desktop/image.jpg"
ERROR: For use with macOS 10.14 Mojave or later.
ERROR: Can't find configuration file 'options.json'.
ERROR: No image was specified.
ERROR: </path/to/desktop/image.jpg> doesn't exist.
ERROR: <option> is not a valid option.
ERROR: The 'default' option is only appropriate when the database is ~/Library/Application Support/Dock/desktoppicture.db
ERROR: This script should not be used in a dual-monitor environment.
ERROR: This script should not be used when multiple Desktops (Spaces) are configured.
Works only with a single Desktop (Space) in a single-display environment.
Not for use with multiple Desktops (Spaces) or in a dual-display environment.
All valid options and their corresponding data are stored in the file options.json
. To list these options for Catalina use the following:
NOTE: The script is parsed by a Python 3 binary, but macOS Catalina only ships with Python 21. To run the script with Python 2 the path to the Python 2 binary - typically /usr/bin/python
2 - is included on the command line.
-
unsorted in the order they appear in
options.json
use/usr/bin/python options.py --version catalina
-
sorted by
category
use/usr/bin/python options.py --version catalina --sort category
-
sorted by
name
use/usr/bin/python options.py --version catalina --sort name
-
sorted by
option
use/usr/bin/python options.py --version catalina --sort option
The set-desktop-catalina-tests.sh
script in the Catalina Tests
directory executes set-desktop.sh
a given number of times (the default is 5 if omitted), each time passing it an option or filename randomly selected from desktop-images.txt
.
The intention is to document the state of the data
and preferences
tables in the desktoppicture.db
database after each iteration. Output is written to set-desktop-catalina-tests.txt
To change the Desktop picture 100 times, cd
into the Catalina Tests
directory and type ./set-desktop-catalina-tests.sh 100
Back to TOC