Tokoro (所) — Japanese for "place." Everything in its place.
A free, open-source macOS menu bar app that saves and restores window layouts.
Save your window positions, sizes, and arrangement across apps and Spaces as named profiles ("Work", "Meetings", "Relax"), then restore them with a click or a keyboard shortcut.
- Save window layouts as named profiles
- Restore layouts instantly — windows snap back to saved positions and sizes
- Multi-display support — tracks which display each window belongs to
- Multi-Space support — moves windows between Spaces using private CGS APIs
- App lifecycle management — launches and hides apps on profile switch
- Global keyboard shortcuts — assign hotkeys to profiles for instant switching
- Menu bar only — no Dock icon, lives in the menu bar
- Zero external dependencies — pure Swift, AppKit, SwiftUI
- JSON persistence — profiles stored in
~/Library/Application Support/Tokoro/
Grab the latest DMG from Releases, open it, and drag Tokoro to Applications.
git clone https://github.com/superlowburn/tokoro.git
cd tokoro
./build.sh
open build/Tokoro.appRequires macOS 13+ and Swift 5.9+ (Xcode Command Line Tools).
- Grant Accessibility permission when prompted on first launch (required to read/set window positions)
- Click the rectangles icon in the menu bar
- Click Save Layout to save your current window arrangement
- Rearrange windows however you want
- Click a saved profile to restore that layout
- Double-click a profile row to restore, or use the ... menu for edit/update/delete
Open a profile's editor to record a global keyboard shortcut. Press any modifier+key combo (e.g., Ctrl+Opt+1) to assign it.
- Window capture:
CGWindowListCopyWindowInfoenumerates all windows,AXUIElementreads precise positions - Window restore:
AXUIElementsetskAXPositionAttributeandkAXSizeAttribute - Space detection: Private
CGSCopyManagedDisplaySpacesandCGSCopySpacesForWindowsAPIs - Space movement: Private
CGSAddWindowsToSpaces/CGSRemoveWindowsFromSpacesAPIs - App launch:
NSWorkspace.shared.openApplication(at:configuration:) - Global hotkeys: Carbon
RegisterEventHotKeyAPI
Tokoro uses private CoreGraphics SPI (CGSBridge.swift) for Space-related features. These APIs are not guaranteed by Apple and may break in future macOS versions. All private API usage is isolated in a single file for easy maintenance.
MIT — free to use, modify, and distribute.