This is a macOS screen saver based on the iconic rain of characters and symbols known from the movie The Matrix.
The screen saver also comes with an app replacing your wallpaper with the animation so you can enjoy being in the matrix all the time 🙂.
brew trust --cask patrickschaper/tap/matrix-screen-saver
brew install --cask patrickschaper/tap/matrix-screen-saver- Wallpaper: open MatrixWallpaper in Applications.
- Saver options: System Settings → Wallpaper → Screen Saver → MatrixScreenSaver → Options….
There is no spoon. There is coffee. Donations help fund a developer license for signing the screen saver.
The saver exposes a native Options… sheet. The values are stored with ScreenSaverDefaults.
| Option | Description | Default |
|---|---|---|
| Number scene | Show the startup number scene before continuous rain. | On |
| Twinkle | Turn on/off the twinkling effect. | On |
| Diffuse | Turn on/off the glow effect. | On |
| Character size | Set the character cell width and height in pixels. Example pairs: 8 x 15, 9 x 17, 10 x 19, 11 x 21, 12 x 23, and 13 x 24. |
9 x 17 |
| Rain density | Set the factor for the density of rain drops. A positive number. | 1.0 |
| Frame rate | Set the frame rate per second. A positive number less than or equal to 1000. | 25 |
| Error rate | Set the factor for the rate of character changes. A non-negative number. | 1.0 |
| Characters | Restrict rain glyphs to a custom set (e.g. ATGC). Leave empty for the default. | (empty) |
| Neo message scene | Show the Neo message intro before the main scene. | On |
| Neo message speed | Typing and pause speed multiplier for the Neo message intro. A positive number. | 1.0 |
| Neo message lines | Lines typed during the Neo message intro. Between 1 and 10 lines, up to 256 characters each. | The 4 classic lines |
| Scan lines intensity | Opacity of the CRT scan line overlay (0 = off, 100 = fully opaque). | 25 |
| Scan lines vertical | Orientation of the scan line overlay (vertical or horizontal). | On (vertical) |
- Native Swift/AppKit screen saver bundle
- Edge-to-edge full-screen saver output, with terminal-style chrome kept in the preview host
- In-process renderer for
rain-foreverwith an optional upstreamnumberintro - Native Options… sheet for Number scene, Twinkle, Diffuse, Character size, Rain density, Frame rate, Error rate, Characters, Neo message scene/speed/lines, and Scan lines
- Preview app for fast iteration without reinstalling
Sources/MatrixScreenSaver/MatrixScreenSaverView.swift- screen saver view, layout, drawing, and option wiringSources/MatrixScreenSaver/NativeMatrixRenderer.swift- native Matrix scene rendererSources/MatrixScreenSaver/MatrixScreenSaverOptions.swift- options model and native configure sheetSources/MatrixScreenSaver/TerminalSupport.swift- small shared terminal types used by the active rendererScripts/install-saver.sh- shared ditto-based installer used by local installsTools/PreviewHost.swift- local preview host used by./preview.shResources/Info.plist- bundle metadata
- macOS
- Xcode Command Line Tools with
swiftc
Full Xcode is not required.
./build.sh
./build-wallpaper.shThese create the screen saver bundle and wallpaper app:
build/MatrixScreenSaver.saver
build/MatrixWallpaper.app
Both build scripts read the current version from ./VERSION and write it into their bundle metadata.
./tests.shCompiles and runs the test suite using swiftc. No Xcode required — Command Line Tools are sufficient.
For wallpaper checks, build the app first and run from a logged-in graphical macOS session:
./wallpaper-tests.sh
./wallpaper-install-tests.shThe UI tests briefly create desktop windows and open Options. Installer tests use a temporary home directory; neither suite changes your real login items.
./preview.shThis rebuilds the bundle, compiles the preview host, and opens the saver in a normal macOS window for quick iteration.
To launch the built wallpaper app without installing:
open build/MatrixWallpaper.app./install.shinstall.sh:
- rebuilds the saver bundle
- strips quarantine from the source bundle and copies it to
~/Library/Screen Savers/MatrixScreenSaver.saver - verifies the installed executable matches the build output
- stops running
ScreenSaverEngine/legacyScreenSaverprocesses so macOS reloads the updated bundle
After installing:
- open System Settings > Wallpaper > Screen saver...
- select MatrixScreenSaver
To relaunch the screen saver host manually:
open -a ScreenSaverEngineTo install and launch the wallpaper app in your user Applications folder:
./install-wallpaper.sh
open ~/Applications/MatrixWallpaper.appThe installer builds and verifies the app, gracefully quits running copies before replacement, and retains preferences. It does not launch the app or enable login startup.
When MatrixScreenSaver is installed in ~/Library/Screen Savers or /Library/Screen Savers,
the wallpaper menu shows Sync with Screen Saver. It is checked by default: the saver
shares the wallpaper's animation. Uncheck it to let the saver animate independently.
The choice survives app restarts and saver reinstallation; opening the menu refreshes
installation detection. This does not change visual options or synchronization between monitors.
This project started as an attempt to wrap cxxmatrix inside a macOS screen saver.
The current implementation is based on the upstream akinomyoga/cxxmatrix project and keeps its look and scene behavior, but it no longer launches an external terminal process at runtime. The active saver is a native in-process Swift/AppKit renderer because ScreenSaverEngine did not reliably render the external terminal stream.
The active renderer currently ports rain-forever and can optionally start with the upstream number intro.



