Contents
Two stores, one export button
The settings pane exports a JSON file containing your shortcut bindings. That is genuinely useful and it is not a complete backup, because every hidden preference set from the terminal — gaps, snap regions, cycling mode, footprint styling, Todo Mode — lives in the preference domain and is not in that file.
| What | Where | Captured by JSON export |
|---|---|---|
| Shortcut bindings | Preference domain | Yes |
| Gaps and edge gaps | Preference domain | No |
| Cycling mode | Preference domain | No |
| Snap regions and modifiers | Preference domain | No |
| Footprint styling | Preference domain | No |
| Hidden size commands | Preference domain | No |
So a real backup is both: the JSON for portability and legibility, and a plist export for everything else.
Backing up properly
mkdir -p ~/dotfiles/rectangle
# 1. the whole preference domain, including every hidden key
defaults export com.knollsoft.Rectangle ~/dotfiles/rectangle/rectangle.plist
# 2. a human-readable list of what you have actually changed
defaults read com.knollsoft.Rectangle > ~/dotfiles/rectangle/settings.txt
# 3. the JSON export from the settings pane, saved into the same folder
# Settings → Settings tab → Export
The plain-text dump is the one you will thank yourself for. In a year, when something behaves oddly, a diff against that file answers the question of what you changed immediately.
Upgrades do not usually clear preferences, but the permission reset that follows them sometimes leads people into a full reinstall. Thirty seconds of backup makes that a non-event.
Restoring on a new machine
# install
brew install --cask rectangle
# restore everything, with the app not running
killall Rectangle 2>/dev/null
defaults import com.knollsoft.Rectangle ~/dotfiles/rectangle/rectangle.plist
# launch and grant Accessibility when prompted
open -a Rectangle
Import while the app is closed. Writing to a preference domain that a running application has cached is the classic way to have your restore silently overwritten.
Accessibility permission is deliberately not portable. It is tied to the machine and must be granted on each one — that is a security property, not an oversight.
The JSON import file and its disappearing act
Place a file named <code>RectangleConfig.json</code> in the application support folder and it is applied at the next launch. The app then renames it with a timestamp so that it is not applied again.
mkdir -p ~/Library/Application\ Support/Rectangle
cp ~/dotfiles/rectangle/RectangleConfig.json ~/Library/Application\ Support/Rectangle/
open -a Rectangle
# afterwards the file has been renamed, e.g.
# RectangleConfig-2026-07-13-094412.json
This trips people up constantly and the behaviour is correct: it is an *import* mechanism, not a live configuration file. Understanding that distinction resolves two separate complaints — "my config file vanished" (it was consumed) and "my settings reset every launch" (something keeps replacing the file, so the import runs again every time).
A symlink into Dropbox or iCloud means the sync service keeps restoring the file after the rename, so your settings are re-imported at every launch and any change you make in the interface is discarded. If you want config-as-code, copy the file into place from a script instead.
Config as code
For anyone who provisions machines regularly, a shell script is more maintainable than a binary plist because the diff is readable:
#!/usr/bin/env bash
set -euo pipefail
killall Rectangle 2>/dev/null || true
D=com.knollsoft.Rectangle
defaults write $D gapSize -float 8
defaults write $D applyGapsToMaximize -int 2
defaults write $D subsequentExecutionMode -int 3
defaults write $D screensOrderedByX -int 1
defaults write $D moveCursor -int 1
defaults write $D ignoredSnapAreas -int 1
defaults write $D centerHalfCycles -int 1
defaults write $D todo -int 1
open -a Rectangle
echo 'configured — grant Accessibility if prompted'
Keep it in your dotfiles repository beside the plist export. The script expresses intent; the plist is the exact snapshot. Having both means you can rebuild from scratch or restore verbatim, whichever the situation calls for.
Teams and managed machines
- Standardising a team on one shortcut scheme is best done with the JSON file plus a short script placing it before first launch.
- Managed devices may have preference domains enforced by a configuration profile, in which case local changes revert by design. Check with whoever administers the fleet before troubleshooting a phantom reset.
- Accessibility permission can often be pre-approved by an MDM profile, which is worth arranging — otherwise every user hits the same first-run dialogue and some of them will decline it.
- Version pinning matters if you distribute a config, since shortcut storage changed format in v0.41 and files from a newer version will not load in older ones.
Get the current build
Rectangle is free and open source. Everything documented here works in the standard build.
Download from rectangleapp.comQuestions
Does the JSON export include gaps and hidden settings?
No. It covers shortcut bindings. Use defaults export for the complete domain.
Why did my config file disappear?
It was applied and then renamed with a timestamp, by design, so it is not reapplied at every launch.
Can I sync settings via iCloud automatically?
Not safely. A synced file that keeps reappearing will re-import at every launch and discard interface changes.
Is the Accessibility permission portable?
No. It is granted per machine and cannot be transferred.