Skip to content

refactor: simplify Hammerspoon grid to fixed 10x8/8x10 per orientation - #20

Merged
lgw4 merged 1 commit into
mainfrom
refactor/hammerspoon-fixed-grid
May 27, 2026
Merged

refactor: simplify Hammerspoon grid to fixed 10x8/8x10 per orientation#20
lgw4 merged 1 commit into
mainfrom
refactor/hammerspoon-fixed-grid

Conversation

@lgw4

@lgw4 lgw4 commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaces the aspect-ratio-derived grid calculation with fixed dimensions: 10x8 for landscape displays and 8x10 for portrait
  • Removes toEven, the three sizing constants (GRID_H_LANDSCAPE, GRID_H_PORTRAIT_MAX, MAX_GRID_LONG), and the accompanying comment block
  • Fixes the setGrid format string (was "%d x %d", now "10x8" / "8x10") — spaces around x prevented correct parsing
  • Updates global defaults (GRIDWIDTH, GRIDHEIGHT) to match the landscape fixed values

The fixed 10-column width matches the default hs.grid.HINTS table width, so the interactive overlay now renders all columns without merging cells.

Test plan

  • Reload Hammerspoon config (Ctrl+Cmd+Shift+R)
  • Press Ctrl+Cmd+Shift+G and confirm the grid overlay shows 10×8 on the built-in display
  • Confirm grid-based window operations (arrow keys, snap) still work as expected

🤖 Generated with Claude Code

Replace the aspect-ratio-derived grid calculation with fixed dimensions:
10x8 for landscape displays and 8x10 for portrait. This matches the
default hs.grid HINTS table width (10), so the interactive overlay now
renders correctly without cell merging. Also fixes the setGrid format
string (removes spaces around "x").

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 27, 2026 03:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Hammerspoon window grid configuration to use fixed grid dimensions per screen orientation, simplifying setup and aligning the landscape grid width with hs.grid.HINTS overlay expectations.

Changes:

  • Set global grid defaults to 10x8 and configure per-display grids as 10x8 (landscape) or 8x10 (portrait).
  • Remove the previous aspect-ratio-based grid sizing logic and helper/constants.
  • Update grid.setGrid usage to use correctly formatted dimension strings (no spaces around x).

Comment thread private_dot_hammerspoon/private_init.lua
@lgw4
lgw4 merged commit af6d5ec into main May 27, 2026
1 check passed
@lgw4
lgw4 deleted the refactor/hammerspoon-fixed-grid branch May 27, 2026 03:33
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.

2 participants