From 3ba8141f522ed9c53211bf0cecb5d0c715a4bc23 Mon Sep 17 00:00:00 2001 From: Diego Marinho Date: Sun, 29 Mar 2026 23:27:01 +1100 Subject: [PATCH] update: manage Rectangle numpad shortcuts --- README.md | 2 +- docs/cheatsheets/rectangle.md | 27 +++------ docs/getting-started.md | 4 +- install_my_programs_mac | 3 +- run_commands/RectangleConfig.json | 94 +++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 22 deletions(-) create mode 100644 run_commands/RectangleConfig.json diff --git a/README.md b/README.md index 579b5ad..b9aca20 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ make install-mac # baseline macOS setup make verify ``` -On macOS, `make install-mac` now installs the toolchain plus the terminal apps `Ghostty`, `WezTerm`, and `iTerm2`, then syncs the managed local setup files: `~/.zshrc`, `~/.tmux.conf`, `~/.vimrc`, `~/.config/starship.toml`, `~/.config/nvim/init.lua`, `~/.wezterm.lua`, `~/.config/ghostty/config`, `~/Library/Application Support/iTerm2/DynamicProfiles/utils-scripts.json`, `~/.config/borders/bordersrc`, `~/.skhdrc`, `~/.codex/config.template.toml`, and local helper scripts in `~/.local/bin`. Add `--desktop-extras` if you also want optional desktop apps and window tools such as `Stats`, `Raycast`, `Rectangle`, `AltTab`, `DockDoor`, `Maccy`, `Espanso`, `Tailscale`, `AppCleaner`, `borders`, `yabai`, and `skhd`; services stay manual unless you start them yourself. +On macOS, `make install-mac` now installs the toolchain plus the terminal apps `Ghostty`, `WezTerm`, and `iTerm2`, then syncs the managed local setup files: `~/.zshrc`, `~/.tmux.conf`, `~/.vimrc`, `~/.config/starship.toml`, `~/.config/nvim/init.lua`, `~/.wezterm.lua`, `~/.config/ghostty/config`, `~/Library/Application Support/iTerm2/DynamicProfiles/utils-scripts.json`, `~/Library/Application Support/Rectangle/RectangleConfig.json`, `~/.config/borders/bordersrc`, `~/.skhdrc`, `~/.codex/config.template.toml`, and local helper scripts in `~/.local/bin`. Add `--desktop-extras` if you also want optional desktop apps and window tools such as `Stats`, `Raycast`, `Rectangle`, `AltTab`, `DockDoor`, `Maccy`, `Espanso`, `Tailscale`, `AppCleaner`, `borders`, `yabai`, and `skhd`; services stay manual unless you start them yourself. First five minutes after install: diff --git a/docs/cheatsheets/rectangle.md b/docs/cheatsheets/rectangle.md index 5a3fb94..0ca83ea 100644 --- a/docs/cheatsheets/rectangle.md +++ b/docs/cheatsheets/rectangle.md @@ -2,20 +2,23 @@ This cheat sheet documents a practical Rectangle layout for a full-size keyboard with a numpad. -## Base layer: `cmd+alt` +## Base layer: `ctrl+alt` -These bindings keep the numpad as the primary spatial layer. +These bindings keep the numpad as the primary spatial layer, with sixths on the corners and large-window actions on the middle row. | Keys | Action | | --- | --- | -| `4` | `moveLeft` | -| `6` | `moveRight` | +| `4` | `leftHalf` | +| `5` | `center` | +| `6` | `rightHalf` | | `7` | `topLeftSixth` | | `8` | `topCenterSixth` | | `9` | `topRightSixth` | | `1` | `bottomLeftSixth` | | `2` | `bottomCenterSixth` | | `3` | `bottomRightSixth` | +| `0` | `maximize` | +| `.` | `restore` | ## Grid layer: `ctrl+alt+shift` @@ -33,21 +36,9 @@ These bindings use Rectangle's 3x3 `ninth` actions, so the numpad behaves like a | `2` | `bottomCenterNinth` | | `3` | `bottomRightNinth` | -## Nav-cluster layer: `ctrl+alt+shift` - -This companion layer provides larger shapes and reset actions without changing the numpad muscle memory. - -| Keys | Action | -| --- | --- | -| `Insert` | `leftHalf` | -| `Home` | `topHalf` | -| `Page Up` | `maximize` | -| `Delete` | `rightHalf` | -| `End` | `bottomHalf` | -| `Page Down` | `center` | - ## Notes -- Keep the numpad base layer stable; add new shapes on other keys instead of replacing the main layout. +- Keep the numpad base layer stable; use `ctrl+alt` for everyday layout moves and `ctrl+alt+shift` for exact 33% placement. - For exact 3x3 placement, prefer Rectangle `ninth` actions over `third` actions. +- `4 5 6` and `0 .` stay on the base layer so the most common large-window actions are still one chord away. - If a shortcut does not trigger, verify it in Rectangle's shortcut UI because some keyboard firmware remaps numpad chords. diff --git a/docs/getting-started.md b/docs/getting-started.md index 19cd0df..f51d30e 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -25,13 +25,13 @@ make install-unix If you want a preview before changing your machine, run the installer script with `--dry-run`. For the extra macOS desktop apps, use `./install_my_programs_mac --desktop-extras --dry-run`. -On macOS, the installer also syncs the repo-managed terminal and editor setup into your home directory, including Zsh, tmux, Vim, Starship, Neovim, WezTerm, Ghostty, iTerm2 dynamic profiles, a default JankyBorders config, a starter `skhd` config, the Codex template config, and helper scripts under `~/.local/bin`. +On macOS, the installer also syncs the repo-managed terminal and editor setup into your home directory, including Zsh, tmux, Vim, Starship, Neovim, WezTerm, Ghostty, iTerm2 dynamic profiles, the Rectangle shortcut config, a default JankyBorders config, a starter `skhd` config, the Codex template config, and helper scripts under `~/.local/bin`. ### Optional macOS window tools Run `make install-mac ARGS="--desktop-extras"` when you also want optional macOS window tools from Homebrew, including `Stats`, `Raycast`, `Rectangle`, `AltTab`, `DockDoor`, `Maccy`, `Espanso`, `Tailscale`, `AppCleaner`, `borders`, `yabai`, and `skhd`. -These are installed but not auto-started by the installer. `borders` reads `~/.config/borders/bordersrc` on launch, so you can tweak the synced theme before starting the service. If you want to use the window-manager services later, start them manually: +These are installed but not auto-started by the installer. `borders` reads `~/.config/borders/bordersrc` on launch, and Rectangle will load `~/Library/Application Support/Rectangle/RectangleConfig.json` on its next launch. If you want to use the window-manager services later, start them manually: ```bash brew services start borders diff --git a/install_my_programs_mac b/install_my_programs_mac index 48f4e39..b2c37c6 100755 --- a/install_my_programs_mac +++ b/install_my_programs_mac @@ -158,7 +158,7 @@ install_macos_desktop_extras() { Next steps for macOS desktop extras: - Stats: launch once if you want menu bar system metrics and choose the modules you want visible. - Raycast: launch once, complete onboarding, and decide whether it should replace Spotlight shortcuts. -- Rectangle: launch once, grant Accessibility access, and import your preferred keyboard layout. +- Rectangle: launch once, grant Accessibility access, and let it load the synced `~/Library/Application Support/Rectangle/RectangleConfig.json` layout. - AltTab: launch once and grant Accessibility access if you want app switching to replace macOS Cmd-Tab. - DockDoor: launch once and grant Accessibility access. - Maccy: launch once; grant Accessibility if you want auto-paste/global shortcut reliability. @@ -268,6 +268,7 @@ install_repo_configs() { backup_copy "./run_commands/my_ghostty_config" "$HOME/.config/ghostty/config" backup_copy "./run_commands/bordersrc" "$HOME/.config/borders/bordersrc" run_cmd chmod +x "$HOME/.config/borders/bordersrc" + backup_copy "./run_commands/RectangleConfig.json" "$HOME/Library/Application Support/Rectangle/RectangleConfig.json" backup_copy "./run_commands/my_wezterm.lua" "$HOME/.wezterm.lua" backup_copy "./run_commands/my_skhdrc" "$HOME/.skhdrc" backup_copy "./run_commands/codex_config.toml" "$HOME/.codex/config.template.toml" diff --git a/run_commands/RectangleConfig.json b/run_commands/RectangleConfig.json new file mode 100644 index 0000000..ed2a5a2 --- /dev/null +++ b/run_commands/RectangleConfig.json @@ -0,0 +1,94 @@ +{ + "bundleId": "com.knollsoft.Rectangle", + "defaults": { + "allowAnyShortcut": { + "bool": true + }, + "alternateDefaultShortcuts": { + "bool": true + } + }, + "shortcuts": { + "bottomCenterNinth": { + "keyCode": 84, + "modifierFlags": 917504 + }, + "bottomCenterSixth": { + "keyCode": 84, + "modifierFlags": 786432 + }, + "bottomLeftNinth": { + "keyCode": 83, + "modifierFlags": 917504 + }, + "bottomLeftSixth": { + "keyCode": 83, + "modifierFlags": 786432 + }, + "bottomRightNinth": { + "keyCode": 85, + "modifierFlags": 917504 + }, + "bottomRightSixth": { + "keyCode": 85, + "modifierFlags": 786432 + }, + "center": { + "keyCode": 87, + "modifierFlags": 786432 + }, + "leftHalf": { + "keyCode": 86, + "modifierFlags": 786432 + }, + "maximize": { + "keyCode": 82, + "modifierFlags": 786432 + }, + "middleCenterNinth": { + "keyCode": 87, + "modifierFlags": 917504 + }, + "middleLeftNinth": { + "keyCode": 86, + "modifierFlags": 917504 + }, + "middleRightNinth": { + "keyCode": 88, + "modifierFlags": 917504 + }, + "restore": { + "keyCode": 65, + "modifierFlags": 786432 + }, + "rightHalf": { + "keyCode": 88, + "modifierFlags": 786432 + }, + "topCenterNinth": { + "keyCode": 91, + "modifierFlags": 917504 + }, + "topCenterSixth": { + "keyCode": 91, + "modifierFlags": 786432 + }, + "topLeftNinth": { + "keyCode": 89, + "modifierFlags": 917504 + }, + "topLeftSixth": { + "keyCode": 89, + "modifierFlags": 786432 + }, + "topRightNinth": { + "keyCode": 92, + "modifierFlags": 917504 + }, + "topRightSixth": { + "keyCode": 92, + "modifierFlags": 786432 + } + }, + "version": "100" +}