Skip to content

Add SpacesSync Spoon#361

Open
johntrandall wants to merge 4 commits intoHammerspoon:masterfrom
johntrandall:add-spaces-sync-spoon
Open

Add SpacesSync Spoon#361
johntrandall wants to merge 4 commits intoHammerspoon:masterfrom
johntrandall:add-spaces-sync-spoon

Conversation

@johntrandall
Copy link
Copy Markdown

Summary

  • Adds SpacesSync, a Spoon that synchronizes macOS Spaces across monitors in configurable sync groups
  • When you switch Spaces on one monitor, all others in the same group follow to the matching Space index
  • Supports arbitrary sync groups (pairs, triples, etc.) with monitors identified by position number (reading order)

Details

  • Uses hs.spaces.watcher to detect space changes, hs.spaces.gotoSpace() to sync targets
  • Chains switches with configurable delay (macOS silently drops rapid calls)
  • Debounce prevents watcher from reacting to its own programmatic switches
  • Checks macOS version (requires 15.0+) and Mission Control settings on start
  • Preloads extensions at load time to avoid lazy-load latency during sync
  • Uses hs.logger for structured logging, hs.spoons.bindHotkeysToSpec for hotkeys

Test plan

  • Tested on macOS 15.5 (Sequoia) with Hammerspoon 1.1.1
  • 4-monitor setup (4x LG SDQHD) with 3-monitor sync group
  • Verified start/stop/toggle lifecycle
  • Verified bindHotkeys with defaultHotkeys
  • Verified docs.json generation (5 variables, 5 methods)
  • Not tested on macOS 14 or 16 (blocks on <15, warns on untested versions)

Homepage: https://github.com/johntrandall/hammerspoon-spaces-sync

🤖 Generated with Claude Code

Keeps Spaces in lockstep across configurable monitor groups.
When you switch Spaces on one monitor, all others in the same
sync group follow to the matching Space index.

Requires macOS 15.0+ (uses private hs.spaces APIs).
Tested on macOS 15.5 with Hammerspoon 1.1.1 on a 4-monitor setup.

Homepage: https://github.com/johntrandall/hammerspoon-spaces-sync

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
johntrandall added a commit to johntrandall/hammerspoon-spaces-sync that referenced this pull request Apr 9, 2026
Link to Hammerspoon/Spoons#361 in README for visibility.
Add dev-docs/publication-checklist.md for future releases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
johntrandall and others added 3 commits April 9, 2026 19:07
- Make start() idempotent (stop first if already running)
- Move extension preloads from module load to start()
- Add config validation: type checks, overlap detection, timing warnings
- Use obj consistently (remove self from internal functions)
- Fix logger docstring for docs.json desc field
- Simplify bindHotkeys to use closure instead of fnutils.partial
- Restore logger.level guards for debug string building

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant