The script set-desktop-big-sur.sh
has been replaced by set-desktop.sh
.
Set a user's Desktop image in macOS 11 Big Sur from the command line. See Limitations
- macos 10.14 Mojave (macOS 11 Big Sur required for the examples below to work)
- Bash 3.2 (Big Sur ships with 3.2.57)
- Python 2.7 (Big Sur 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 Big Sur, 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 Big\ Sur\ Tests/set-desktop-big-sur-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-big-sur-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 11.5.2 Big Sur.
See A Comparison of Apple-Supplied Desktop Images Since macOS 10.14 Mojave
Setting the image to Dynamic (e.g. The Beach Dynamic) ensures it changes throughout the day, based on your location.
./set-desktop.sh big-sur
./set-desktop.sh big-sur-light
./set-desktop.sh big-sur-dark
./set-desktop.sh catalina
./set-desktop.sh catalina-light
./set-desktop.sh catalina-dark
./set-desktop.sh cliffs
./set-desktop.sh cliffs-light
./set-desktop.sh cliffs-dark
./set-desktop.sh lake
./set-desktop.sh lake-light
./set-desktop.sh lake-dark
./set-desktop.sh desert
./set-desktop.sh desert-light
./set-desktop.sh desert-dark
./set-desktop.sh beach
./set-desktop.sh beach-light
./set-desktop.sh beach-dark
./set-desktop.sh solar
Setting the image to Automatic (e.g. Peak Automatic) ensures it conforms to the Light, Dark or Auto setting in System Preferences > General > Appearance.
./set-desktop.sh graphic
./set-desktop.sh light
./set-desktop.sh dark
./set-desktop.sh peak
./set-desktop.sh peak-light
./set-desktop.sh peak-dark
./set-desktop.sh tree
./set-desktop.sh tree-light
./set-desktop.sh tree-dark
./set-desktop.sh valley
./set-desktop.sh valley-light
./set-desktop.sh valley-dark
./set-desktop.sh dome
./set-desktop.sh dome-light
./set-desktop.sh dome-dark
./set-desktop.sh iridescence
./set-desktop.sh iridescence-light
./set-desktop.sh iridescence-dark
./set-desktop.sh mountains
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Mountains.heic"
./set-desktop.sh aerial
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Aerial.heic"
./set-desktop.sh horizon
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Horizon.heic"
./set-desktop.sh coastline
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Coastline.heic"
./set-desktop.sh shore
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Shore Rocks.heic"
./set-desktop.sh edge
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Waters Edge.heic"
./set-desktop.sh road
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Road.heic"
./set-desktop.sh succulents
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Night Succulents.heic"
./set-desktop.sh grasses
./set-desktop.sh "/System/Library/Desktop Pictures/Big Sur Night Grasses.heic"
./set-desktop.sh coast
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Coast.heic"
./set-desktop.sh evening
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Evening.heic"
./set-desktop.sh rock
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Rock.heic"
./set-desktop.sh shoreline
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Shoreline.heic"
./set-desktop.sh clouds
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Clouds.heic"
./set-desktop.sh silhouette
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Silhouette.heic"
./set-desktop.sh sunset
./set-desktop.sh "/System/Library/Desktop Pictures/Catalina Sunset.heic"
./set-desktop.sh stream-red
./set-desktop.sh "/System/Library/Desktop Pictures/Light Stream Red.heic"
./set-desktop.sh stream-blue
./set-desktop.sh "/System/Library/Desktop Pictures/Light Stream Blue.heic"
./set-desktop.sh stream-pink
./set-desktop.sh "/System/Library/Desktop Pictures/Light Stream Pink.heic"
./set-desktop.sh stream-green
./set-desktop.sh "/System/Library/Desktop Pictures/Light Stream Green.heic"
./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 "/System/Library/Desktop Pictures/Solid Colors/Black.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 Big Sur use the following:
-
unsorted in the order they appear in
options.json
use./options.py --version big-sur
-
sorted by
category
use./options.py --version big-sur --sort category
-
sorted by
name
use./options.py --version big-sur --sort name
-
sorted by
option
use./options.py --version big-sur --sort option
The set-desktop-big-sur-tests.sh
script in the Big Sur 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-big-sur-tests.txt
To change the Desktop picture 100 times, cd
into the Big Sur Tests
directory and type ./set-desktop-big-sur-tests.sh 100
Back to TOC