Terminal Commands for Hidden Preferences
Rectangle Pro is built on top of Rectangle, and many of Rectangle’s settings are outside of the UI, available as Terminal command configurations. These are carried over here to Rectangle Pro, but with the bundle identifier com.knollsoft.Hookshot (Rectangle Pro was initially named Hookshot, and so it remains with the same bundle identifier).
A number of the commands below are for configuring keyboard shortcuts, and you’ll need to know the key code and modifier flags integer values.
Spectacle Keyboard Shortcuts
Section titled “Spectacle Keyboard Shortcuts”By default, Rectangle Pro does not use Spectacle’s keyboard shortcuts. Unlike Rectangle, Rectangle Pro doesn’t provide a toggle for the Spectacle shortcuts, and it is enabled by the following Terminal command.
defaults write com.knollsoft.Hookshot alternateDefaultShortcuts -bool trueCycle thirds on repeated Center Half commands
Section titled “Cycle thirds on repeated Center Half commands”Set Center Half to cycle third sizes: 1/2 -> 2/3 -> 1/3 with:
defaults write com.knollsoft.Hookshot centerHalfCycles -int 1Resize on Directional Move
Section titled “Resize on Directional Move”By default, the commands to move to certain edges will not resize the window.
If resizeOnDirectionalMove is enabled, the halves to thirds mode is instead used.
This means that when moving to the left/right, the width will be changed, and when moving to the top/bottom, the height will be changed.
The size will cycle between 1/2 -> 2/3 -> 1/3 of the screen’s width/height.
Note that if subsequent execution mode is set to cycle displays when this is enabled, Move Left and Move Right will always resize to 1/2, and pressing the key again will move to the next display.
defaults write com.knollsoft.Hookshot resizeOnDirectionalMove -bool trueAdjust macOS Ventura Stage Manager size
Section titled “Adjust macOS Ventura Stage Manager size”By default, the Stage Manager area will be set to 190 pixels, if enabled.
defaults write com.knollsoft.Hookshot stageSize -float <VALUE>To set it to a proportion of your screen’s width, set it to a value between 0 and 1.
defaults write com.knollsoft.Hookshot stageSize -float <VALUE_BETWEEN_0_AND_1>Enable Todo Mode
Section titled “Enable Todo Mode”See the wiki for more info.
defaults write com.knollsoft.Hookshot todo -int 1Only allow drag-to-snap when modifier keys are pressed
Section titled “Only allow drag-to-snap when modifier keys are pressed”Modifier keys can be combined by summing the Integer Values.
| Modifier Key | Integer Value |
|---|---|
| cmd | 1048576 |
| option | 524288 |
| ctrl | 262144 |
| shift | 131072 |
| fn | 8388608 |
This command would be for restricting snap to the cmd key:
defaults write com.knollsoft.Hookshot snapModifiers -int 1048576Almost Maximize
Section titled “Almost Maximize”By default, “Almost Maximize” will resize the window to 90% of the screen (width & height).
defaults write com.knollsoft.Hookshot almostMaximizeHeight -float <VALUE_BETWEEN_0_&_1>defaults write com.knollsoft.Hookshot almostMaximizeWidth -float <VALUE_BETWEEN_0_&_1>Add an extra centering command with custom size
Section titled “Add an extra centering command with custom size”This extra command is not available in the UI. You’ll need to know which keycode and modifier flags you want.
defaults write com.knollsoft.Hookshot specified -dict-add keyCode -float 8 modifierFlags -float 1966080defaults write com.knollsoft.Hookshot specifiedHeight -float 1050defaults write com.knollsoft.Hookshot specifiedWidth -float 1680Add an extra centering with prominence command
Section titled “Add an extra centering with prominence command”There is an extra command that horizontally centers the window but moves up the window vertically slightly from the center to add visual weight. Similar to extra centering, you will need to know which keycode and modifier flags you want.
The key code is:
- centerProminently
For example, the command for setting the shortcut to ctrl option command C would be:
defaults write com.knollsoft.Hookshot centerProminently -dict-add keyCode -float 8 modifierFlags -float 1835305Add extra “ninths” sizing commands
Section titled “Add extra “ninths” sizing commands”Commands for resizing to screen ninths are not available in the UI.
The key codes are:
- topLeftNinth
- topCenterNinth
- topRightNinth
- middleLeftNinth
- middleCenterNinth
- middleRightNinth
- bottomLeftNinth
- bottomCenterNinth
- bottomRightNinth
For example, the command for setting the top left ninth shortcut to ctrl opt shift 1 would be:
defaults write com.knollsoft.Hookshot topLeftNinth -dict-add keyCode -float 18 modifierFlags -float 917504Add extra “eighths” sizing commands
Section titled “Add extra “eighths” sizing commands”Commands for resizing to screen eighths are not available in the UI. This divides the screen up into a 4x2 grid.
The key codes are:
- topLeftEighth
- topCenterLeftEighth
- topCenterRightEighth
- topRightEighth
- bottomLeftEighth
- bottomCenterLeftEighth
- bottomCenterRightEighth
- bottomRightEighth
For example, the command for setting the top left eighth shortcut to ctrl opt shift 1 would be:
defaults write com.knollsoft.Hookshot topLeftEighth -dict-add keyCode -float 18 modifierFlags -float 917504Add additional “thirds” sizing commands
Section titled “Add additional “thirds” sizing commands”These commands for resizing to corner two-thirds are not available in the UI but can be configured via CLI.
The key codes are:
- topLeftThird
- topRightThird
- bottomLeftThird
- bottomRightThird
(these correspond to two-thirds, and when repeated will cycle through each of the sizes)
For example, the command for setting the top left two-thirds shortcut to ctrl opt shift 1 would be:
defaults write com.knollsoft.Hookshot topLeftThird -dict-add keyCode -float 18 modifierFlags -float 917504Add doubling/halving window sizing commands
Section titled “Add doubling/halving window sizing commands”These commands for doubling or halving the window width/height are not available in the UI but can be configured via CLI.
The key codes are:
- doubleHeightUp
- doubleHeightDown
- doubleWidthLeft
- doubleWidthRight
- halveHeightUp
- halveHeightDown
- halveWidthLeft
- halveWidthRight
The action direction (e.g., “Right”) is the direction that the center of the window will move towards as a result of resizing.
For example, the command for setting the doubleWidthRight shortcut to ctrl option shift right would be:
defaults write com.knollsoft.Hookshot doubleWidthRight -dict-add keyCode -float 124 modifierFlags -float 11403555Add additional tiling and cascading commands
Section titled “Add additional tiling and cascading commands”Commands for tiling and cascading the visible windows are not available in the UI but can be configured via CLI.
The key codes are:
- tileAll
- cascadeAll
- cascadeActiveApp
- tileActiveApp
tileAll and cascadeAll act on all visible windows.
cascadeActiveApp cascades and brings to the front only windows belonging to the currently active (foremost) app, leaving all other windows alone.
tileActiveApp tiles only windows belonging to the currently active (foremost) app into a grid, leaving all other windows alone.
For example, the command for setting the cascadeActiveApp shortcut to ctrl shift 2 would be:
defaults write com.knollsoft.Hookshot cascadeActiveApp -dict-add keyCode -float 2 modifierFlags -float 393475Modify the “footprint” displayed for drag-to-snap area
Section titled “Modify the “footprint” displayed for drag-to-snap area”Adjust the alpha (transparency). Default is 0.3.
defaults write com.knollsoft.Hookshot footprintAlpha -float <VALUE_BETWEEN_0_&_1>Change the border width. Default is 2 (used to be 1).
defaults write com.knollsoft.Hookshot footprintBorderWidth -float <NUM_PIXELS>Disable the fade.
defaults write com.knollsoft.Hookshot footprintFade -int 2Change the color.
defaults write com.knollsoft.Hookshot footprintColor -string "{\"red\":0,\"blue\":0.5,\"green\":0.5}"Change the animation duration. The value is a multiplier. Default is 0 (no animation).
defaults write com.knollsoft.Hookshot footprintAnimationDurationMultiplier -float <MULTIPLIER>Move Up/Down/Left/Right: Don’t center on edge
Section titled “Move Up/Down/Left/Right: Don’t center on edge”By default, the directional move will center the window along the edge that the window is being moved to.
defaults write com.knollsoft.Hookshot centeredDirectionalMove -int 2Make Smaller limits
Section titled “Make Smaller limits”By default, “Make Smaller” will decrease the window until it reaches 25% of the screen (width & height).
defaults write com.knollsoft.Hookshot minimumWindowWidth -float <VALUE_BETWEEN_0_&_1>defaults write com.knollsoft.Hookshot minimumWindowHeight -float <VALUE_BETWEEN_0_&_1>Make Smaller/Make Larger size increments
Section titled “Make Smaller/Make Larger size increments”By default, “Make Smaller” and “Make Larger” change the window height/width by 30 pixels.
defaults write com.knollsoft.Hookshot sizeOffset -float <NUM_PIXELS>Make Smaller/Make Larger “curtain resize” with gaps
Section titled “Make Smaller/Make Larger “curtain resize” with gaps”By default, windows touching the edge of the screen will keep those shared edges the same while only resizing the non-shared edge. With window gaps, this is a little ambiguous since the edges don’t actually touch the screen, so you can disable it for traditional, floating resizing:
defaults write com.knollsoft.Hookshot curtainChangeSize -int 2Changing the margin for the snap areas
Section titled “Changing the margin for the snap areas”Each margin is configured separately, and has a default value of 5
defaults write com.knollsoft.Hookshot snapEdgeMarginTop -int 10defaults write com.knollsoft.Hookshot snapEdgeMarginBottom -int 10defaults write com.knollsoft.Hookshot snapEdgeMarginLeft -int 10defaults write com.knollsoft.Hookshot snapEdgeMarginRight -int 10Setting gaps at the screen edges
Section titled “Setting gaps at the screen edges”You can specify gaps at the edges of your screen that will be left uncovered by window resizing operations. This is useful if, for example, you use a dock replacement that should not have windows overlapping it.
defaults write com.knollsoft.Hookshot screenEdgeGapTop -int 10defaults write com.knollsoft.Hookshot screenEdgeGapBottom -int 10defaults write com.knollsoft.Hookshot screenEdgeGapLeft -int 10defaults write com.knollsoft.Hookshot screenEdgeGapRight -int 10You can also separately specify the gap for a screen with a notch. Useful for multi-display setups if you are using a menu bar replacement.
defaults write com.knollsoft.Hookshot screenEdgeGapTopNotch -int 5If you want these gaps to be applied on your main screen only, you can set screenEdgeGapsOnMainScreenOnly. Useful for multi-display setups where only one screen has some dock replacement.
defaults write com.knollsoft.Hookshot screenEdgeGapsOnMainScreenOnly -bool trueIgnore specific drag-to-snap areas
Section titled “Ignore specific drag-to-snap areas”Each drag to snap area on the edge of a screen can be ignored with a single Terminal command, but it’s a bit field setting so you’ll have to determine the bit field for which ones you want to disable.
| Bit | Snap Area | Window Action |
|---|---|---|
| 0 | Top | Maximize |
| 1 | Bottom | Thirds |
| 2 | Left | Left Half |
| 3 | Right | Right Half |
| 4 | Top Left | Top Left Corner |
| 5 | Top Right | Top Right Corner |
| 6 | Bottom Left | Bottom Left Corner |
| 7 | Bottom Right | Bottom Right Corner |
| 8 | Top Left Below Corner | Top Half |
| 9 | Top Right Below Corner | Top Half |
| 10 | Bottom Left Above Corner | Bottom Half |
| 11 | Bottom Right Above Corner | Bottom Half |
To disable the top (maximize) snap area, execute:
defaults write com.knollsoft.Hookshot ignoredSnapAreas -int 1To disable the Top Half and Bottom Half snap areas, the bit field would be 1111 0000 0000, or 3840
defaults write com.knollsoft.Hookshot ignoredSnapAreas -int 3840Disabling gaps when maximizing
Section titled “Disabling gaps when maximizing”By default, the “Gaps between windows” setting applies to “Maximize” and “Maximize Height”.
To disable the gaps for “Maximize”, execute:
defaults write com.knollsoft.Hookshot applyGapsToMaximize -int 2To disable the gaps for “Maximize Height”, execute:
defaults write com.knollsoft.Hookshot applyGapsToMaximizeHeight -int 2Prevent a window that is quickly dragged above the menu bar from going into Mission Control
Section titled “Prevent a window that is quickly dragged above the menu bar from going into Mission Control”Important: This can cause issues with dragging and dropping in certain apps like Adobe Illustrator, and can affect text selection in a few apps as well.
Windows that are slowly moved above the menu bar will still go into Mission Control.
Once this is enabled, the checkbox for it is visible in the Snap Areas tab of the Preferences window.
defaults write com.knollsoft.Hookshot missionControlDragging -int 2Change the allowed off-screen distance. The value is in pixels and is tied to the speed. Default is 25.
defaults write com.knollsoft.Hookshot missionControlDraggingAllowedOffscreenDistance -float <DISTANCE>Change the disallowed duration. The value is in milliseconds. Default is 250.
defaults write com.knollsoft.Hookshot missionControlDraggingDisallowedDuration -int <DURATION>Change the behavior of double-clicking the window title bar
Section titled “Change the behavior of double-clicking the window title bar”To disable restore when double-clicked again:
defaults write com.knollsoft.Hookshot doubleClickTitleBarRestore -int 2To disable double-clicking the window title bar only for specific bundle ids (in example, Outlook):
defaults write com.knollsoft.Hookshot doubleClickTitleBarIgnoredApps -string "[\"com.microsoft.Outlook\"]"Change the order of displays to order by x coordinate for next and previous display commands
Section titled “Change the order of displays to order by x coordinate for next and previous display commands”By default, display order is left-to-right, line-by-line. You can change this to be ordered by x coordinate, left-to-right, regardless of which vertical position of the display. This was the default behavior prior to v0.87.
defaults write com.knollsoft.Hookshot screensOrderedByX -int 1