GridSnap – 开源 Divvy 风格的 macOS 窗口快捷排列工具
GridSnap – an open-source Divvy-style window snapper for macOS

原始链接: https://github.com/konieczkow/gridsnap

GridSnap 是一款免费、开源的 macOS Divvy 替代品,使用网格叠加功能整理窗口。按下 Ctrl+Opt+D 激活,拖动单元格整理活动窗口,或选择光标下方的窗口。它支持自定义网格大小、间距和预设,以及用于一键整理的全局快捷键。该应用支持多个显示器,并记住窗口所在的显示器,并包含撤销/重做功能。它是一个轻量级的菜单栏应用,无 Dock 图标、无网络访问和无遥测。macOS 14+ 需要玻璃叠加效果(旧版为磨砂),首次启动需要授权辅助功能。可通过 Homebrew、下载的 ZIP 或使用 Swift 从源码编译获取,采用 MIT 许可证。

GridSnap是一款风格类似Divvy的开源macOS窗口管理器,作为SizeUp的替代品发布(SizeUp在macOS更新后已无法正常工作)。一位Hacker News用户转而使用它,以获得更好的多桌面和跨屏窗口管理。开发者报告在M4 Pro上无显著的调整大小延迟,并欢迎Bug反馈,尽管有一位评论员警告即时拖动调整大小可能会导致某些应用出现延迟。
相关文章

原文

An open source alternative to Divvy for macOS. Press a shortcut, a grid appears, drag across the cells you want, and the window snaps there. Save a region as a preset and it becomes a one-keystroke snap.

Pressing the shortcut, dragging on the grid, and the window following

  • Grid overlay with live preview: the window follows your drag and jumps back if you cancel
  • Presets with their own global shortcuts; a Full screen preset on ⌃⌥F comes built in
  • Undo the last snap
  • Configurable grid size and gap between windows
  • Snap the focused window or the one under the cursor
  • Works across multiple displays
  • Menu bar app, launch at login, no Dock icon
  • No network access, no analytics, no accounts
  • macOS 14 or later. Tested on macOS 26; on older versions the grid gets a frosted panel instead of the glass material.
  • Apple Silicon or Intel.
  • To build: Xcode Command Line Tools with the macOS 26 SDK. No Xcode project, swiftc compiles the files directly.

With Homebrew:

brew install --cask konieczkow/tap/gridsnap

Or download GridSnap-x.y.z.zip from the latest release, unzip it and drag GridSnap to Applications.

On first launch GridSnap asks for Accessibility, which it needs to move other apps' windows. Turn it on under System Settings › Privacy & Security › Accessibility (the menu bar icon has a Grant Accessibility… item that opens that pane). GridSnap picks the grant up on its own, no relaunch needed.

Or build it yourself:

git clone https://github.com/konieczkow/gridsnap.git
cd gridsnap
./build.sh install
open /Applications/GridSnap.app
Action How
Show the grid ⌃⌥D (change it in Settings)
Snap Click or drag cells, release
Cancel Esc, or drag outside the panel and release
Dismiss Click anywhere outside the grid
Save a preset Hold Shift when releasing, or use + in Settings
Apply a preset Its shortcut, or the Presets menu
Undo last snap ⌃⌥Z by default, press again to redo

The grid appears on the display under the cursor and the window snaps to that display, so moving the mouse to another monitor before pressing the shortcut moves the window there. Presets snap to the display the window is already on.

Wider gutters in the grid mark halves, thirds and quarters.

Settings (menu bar icon › Settings…) holds both shortcuts, columns and rows, the gap in points between snapped windows, the target rule, and the presets table. Names and shortcuts are editable in place; − removes the selected preset.

./build.sh            # builds build/GridSnap.app
./build.sh install    # also copies it to /Applications

Resources/icon.png is the icon source; regenerate AppIcon.icns from it with iconutil if you change it.

Files in Sources/: main.swift startup, AX.swift window plumbing, Grid.swift overlay, Presets.swift, Hotkeys.swift, ShortcutButton.swift recorder, SettingsWindow.swift, Menu.swift, Defaults.swift stored settings.

macOS ties the Accessibility grant to the app's code signature. The default ad-hoc signature changes with every build, so you'd re-grant permission after each rebuild. To avoid that, create a self-signed certificate once (Keychain Access › Certificate Assistant › Create a Certificate, type "Code Signing", name it GridSnap Dev) and the build script picks it up. Any other identity works via CODESIGN_IDENTITY="name" ./build.sh.

  • Full-screen windows ignore snapping.
  • Some apps enforce a minimum window size and won't shrink to a small cell. The window then stays on screen and overlaps the neighbouring cells.

MIT, see LICENSE.

联系我们 contact @ memedata.com