melreusthe rectangle field manual

Config

Backing Up and Syncing Your Configuration Across Machines

Two separate stores hold your configuration and only one of them has an export button. Backing up just that one is why people still lose settings.

13 Jul 2026 · 6 min read · updated for current macOS

Terminal — zsh$ defaults export com.knollsoft.Rectangle ~/dotfiles/rectangle.plist$ cp ~/Library/Application\ Support/Rectangle/RectangleConfig.json ~/dotfiles/# shortcuts AND hidden preferences, both captured$ git -C ~/dotfiles commit -am 'rectangle config'[main 4f2a1c9] rectangle config
A complete backup is two files, not one. The JSON export alone misses every terminal-set preference.

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.

WhatWhereCaptured by JSON export
Shortcut bindingsPreference domainYes
Gaps and edge gapsPreference domainNo
Cycling modePreference domainNo
Snap regions and modifiersPreference domainNo
Footprint stylingPreference domainNo
Hidden size commandsPreference domainNo

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.

Do this before every macOS upgrade

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).

Do not symlink it from a synced folder

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

Get the current build

Rectangle is free and open source. Everything documented here works in the standard build.

Download from rectangleapp.com

Questions

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.