A Windows port of Rectangle — the keyboard-driven window tiling manager for macOS.
Full credit goes to Ryan Hanson and the original Rectangle app. I loved using it on macOS so much that I wanted the same experience on Windows. I had used FancyZones (PowerToys) before, but Rectangle's keyboard shortcuts are much more convenient: halves, quarters, thirds, maximize, center, restore, and move between displays, all from the keyboard without touching the mouse. This project aims to replicate that workflow on Windows.
RectangleWin is a minimal tray app (Rust + Tauri): global hotkeys (Win+Alt by default), optional launch at startup, and configurable gaps. Edit config.json to change shortcuts.
- Windows 10/11
- Rust toolchain (use the default
x86_64-pc-windows-msvctarget) - Node.js (and npm or pnpm) for the frontend
- Visual Studio Build Tools 2022 (recommended) or Visual Studio with the “Desktop development with C++” workload. The Rust MSVC target needs:
- MSVC x64/x86 build tools
- Windows 10/11 SDK
- a working Developer shell environment
The most reliable local setup on Windows is to use the VS 2022 Build Tools developer shell. This repo includes a helper that finds a usable installation and loads the right PATH, INCLUDE, and LIB values for the current PowerShell session.
From the repo root:
. .\scripts\enter-vsdevshell.ps1
cd app\src-tauri
cargo testIf that script cannot find a usable toolchain, install or repair:
- Visual Studio Build Tools 2022
- Desktop development with C++
- MSVC v143 x64/x86 build tools
- Windows 10/11 SDK
The build uses the MSVC toolchain (cl.exe, Windows headers). Those are only available in a Developer environment. Use either:
- Start menu → open “x64 Native Tools Command Prompt for VS 2022” (or your VS version), then run the build commands in that terminal, or
- In a normal terminal, run the VS dev script first, then build:
If VS is in a non-default path, pass
. .\scripts\enter-vsdevshell.ps1 cd app npm run tauri build
-PreferredInstallPathto the helper script or use the “Developer PowerShell for VS” shortcut.
Run both the frontend and backend checks:
pwsh -File .\scripts\check.ps1Run the fast local variant used by pre-commit:
pwsh -File .\scripts\check.ps1 -Mode fastRun them separately:
pwsh -File .\scripts\check.ps1 -Frontend
pwsh -File .\scripts\check.ps1 -BackendFrontend unit tests:
cd app
npm run testBackend coverage uses cargo-llvm-cov and the same VS developer-shell bootstrap as the test workflow.
One-time prerequisites:
rustup component add llvm-tools-preview
cargo install cargo-llvm-covOr let the helper install them:
pwsh -File .\scripts\coverage.ps1 -InstallPrereqsGenerate an HTML report:
pwsh -File .\scripts\coverage.ps1The report is written to app/src-tauri/target/llvm-cov-html/html/index.html.
Generate LCOV output instead:
pwsh -File .\scripts\coverage.ps1 -LcovThe LCOV file is written to app/src-tauri/target/llvm-cov.info.
Frontend coverage:
cd app
npm run coverageThe frontend HTML report is written to app/coverage/index.html.
Install the repo-local pre-commit hook:
pwsh -File .\scripts\install-git-hooks.ps1Installed hooks:
pre-commitpre-push
Hook behavior:
pre-commitruns targeted fast checks based on staged files- frontend changes under
app/triggernpm run typecheckandnpm run test - Rust changes under
app/src-tauri/triggercargo test - docs-only changes skip app checks
pre-pushruns the full validation suite viapwsh -File .\scripts\check.ps1- coverage is not run from hooks; run it explicitly when needed
From the repo root:
cd app
npm install
npm run tauri devProduction build:
cd app
npm run tauri buildThe built executable and installers are in app/src-tauri/target/release/ (e.g. app.exe) and app/src-tauri/target/release/bundle/ (NSIS and MSI installers).
After running npm run tauri build in app/, installers are produced in app/src-tauri/target/release/bundle/ (e.g. NSIS .exe and MSI). Use whichever you prefer for distribution.
Config path: %LocalAppData%\RectangleWin\config.json. You can change hotkeys (default: Win+Alt + key), gap size, and launch-at-startup. Restart the app after editing.
- Rectangle (macOS): github.com/rxhanson/Rectangle — window management app based on Spectacle, by Ryan Hanson.
MIT. See LICENSE. This project is a Windows port inspired by Rectangle; Rectangle is Copyright (c) 2019–2025 Ryan Hanson (based on Spectacle, Copyright (c) 2017 Eric Czarny).