wallgrab

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 37 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

wallgrab


wallgrab downloads Apple Aerial wallpapers. These are the videos that macOS and tvOS play as a screen saver.

wallgrab reads the same manifest that macOS reads, so it lists every wallpaper that Apple publishes, in any of the 44 languages that Apple provides names for. It can write a playlist for a video player, and it can draw a thumbnail of each wallpaper in a terminal that supports graphics.

Unit Tests Go Reference Releases Discord Discussion

Installing

Install in the usual Go fashion:

$ go install github.com/kenshaw/wallgrab@latest

Using

# list the available wallpapers
$ wallgrab list

# list the wallpapers with the size of each one
$ wallgrab list --sizes

# list the names in another language
$ wallgrab list --lang ja

# list the OS versions that have wallpapers
$ wallgrab versions

# list the wallpapers of an older macOS release
$ wallgrab list --version v15.0

# draw a thumbnail of each wallpaper in the terminal
$ wallgrab show

# download the wallpapers
$ wallgrab grab

# download to a directory, and write a playlist
$ wallgrab grab --dest /path/to/wallpapers --m3u aerials.m3u

# use with mpvpaper
$ mpvpaper -o 'no-audio --loop-playlist shuffle --speed=0.2' '*' /path/to/wallpapers/aerials.m3u

Run wallgrab list --lang xx to see every language that Apple provides names for. The command fails and lists them. See Sway for a desktop configuration that plays the wallpapers, and Notes for the mpv commands that control it.

OS versions

Apple publishes a separate set of wallpapers for each major OS release, and keeps the older sets in place. wallgrab downloads the newest set by default. Run wallgrab versions to list them all. --version chooses an older set, and takes a number or a codename:

Release Codename Wallpapers Languages
v14.0 Sonoma 134 39
v15.0 Sequoia 137 40
v26.0 Tahoe 156 43
v27.0 (newest) Golden Gate 164 44

--version 27, --version 27.0, --version v27.0, and --version "golden gate" all mean the same release. A codename ignores case and spacing, so goldengate works too.

wallgrab reads the list of OS versions from Apple's device management feed at https://gdmf.apple.com/v2/pmv, so a new macOS release needs no change here. Apple lists a version before it publishes the wallpapers for it, so wallgrab walks back from the newest version until a set answers.

That feed carries version numbers alone. Apple publishes no feed that names a release, so wallgrab reads the codenames from https://endoflife.date/api/macos.json. A release that the codename feed does not name still works by number, and wallgrab versions shows it with no codename.

Apple changed the layout of these files at v26. Up to v15 the names are one plist per language, and from v26 they are one table that holds every language. wallgrab reads both, so every release above works the same way.

--os accepts macos and tvos. Apple publishes one set of wallpapers for both, so the two give the same result today. The option exists so that a tvOS set can be added if Apple ever separates them.

The cache

wallgrab keeps the files that it needs to find the wallpapers in ~/.cache/wallgrab for a week. It does not cache the wallpapers themselves.

When a cached file is truncated or corrupt, wallgrab deletes that one file and downloads it again. To delete the whole cache directory instead, add --clear to any command:

$ wallgrab list --clear
Sway

Example sway config:

# set up some variables
set {
  # modifier keys (windows key)
  $mod Mod4
  $shf $mod+Shift

  # control path for mpv
  $mpvctl $HOME/.local/lib/mpvpaper/control

  # sets the output for the media title (read from the m3u) to the bottom right
  $mpvopt \
    --hwdec \
    --no-audio \
    --input-ipc-server=$mpvctl \
    --shuffle \
    --loop-playlist \
    --speed=0.8 \
    --osd-playing-msg='\${osd-ass-cc/0}{\\\\\\\\\\\\\\\\an3}\${osd-ass-cc/1}\${media-title}'

  # alternate location, bottom center with margin from bottom, stay on screen
  # for 7.5 seconds
  $mpvopt \
    --hwdec \
    --no-audio \
    --input-ipc-server=$mpvctl \
    --loop-playlist \
    --shuffle \
    --speed=0.8 \
    --osd-margin-y=70 \
    --osd-playing-msg-duration=7500 \
    --osd-playing-msg='\${osd-ass-cc/0}{\\\\\\\\\\\\\\\\an2}\${osd-ass-cc/1}\${media-title}'
}

# run mpvpaper as wallpaper
exec {
  mpvpaper -o "$mpvopt" '*' $HOME/Pictures/backgrounds/aerials/aerials.m3u
}

# bind modifier key + media keys to change/pause background
bindsym {
  $mod+XF86AudioStop exec socat - $mpvctl <<< 'cycle pause'
  $mod+XF86AudioPrev exec socat - $mpvctl <<< 'playlist-prev'
  $mod+XF86AudioPlay exec socat - $mpvctl <<< 'cycle pause'
  $mod+XF86AudioNext exec socat - $mpvctl <<< 'playlist-next'
  $shf+XF86AudioPlay exec socat - $mpvctl <<< 'show-text ${osd-ass-cc/0}{\\an2}${osd-ass-cc/1}${media-title} 7500'
}

Note:

The number of backslashes above is correct. Sway config and mpvpaper each remove one level of escaping.

To use with swaylock-plugin, see the lock script here.

Notes

Quick commands:

$ export mpvctl=/path/to/control/socket

# display text in bottom right corner
$ socat - $mpvctl <<< 'show-text ${osd-ass-cc/0}{\\an3}${osd-ass-cc/1}${media-title}'

# set pause
$ socat - $mpvctl <<< 'set pause yes'

# cycle pause
$ socat - $mpvctl <<< 'cycle pause'

# get property
$ socat - $mpvctl <<< '{ "command": ["get_property", "pause"] }'

# list properties
$ mpv --list-properties

Note:

${osd-ass-cc/0} starts subtitle escaping. ${osd-ass-cc/1} ends it.

\an<pos> sets the position with numpad numbers. 3 is the lower right corner.

Documents

Documentation

Overview

Command wallgrab downloads Apple's Aerial wallpapers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址