Skip to content

hammerspoon: replace Seal with a native glass launcher - #66

Merged
cmpadden merged 1 commit into
mainfrom
hammerspoon/native-launcher
Oct 28, 2026
Merged

cmpadden merged 1 commit into
mainfrom
hammerspoon/native-launcher

Conversation

@cmpadden

@cmpadden cmpadden commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

Replace Seal's hs.chooser interface with a native glass launcher while retaining its Lua plugin engine and the existing Cmd+P shortcut.

Image
  • Vendor a local Launcher.spoon under hammerspoon/.hammerspoon/vendored/, with upstream provenance and MIT attribution. Keep the four configured plugins and existing seal_* settings namespaces.
  • Add modules.chooser, a chooser-compatible adapter backed by a persistent Swift/AppKit process. No global hs.chooser patch and no chooser fallback.
  • Share the glass background implementation with the existing toast helper, and use one atomic-build recipe for both native executables.
  • Keep the launcher compact (640-point default cap), with separate search-icon layout, transparent result rows, a subtle selection highlight, and transparent margins that prevent clipped shadow corners.
  • Remove the Hammerspoon CLAUDE.md as requested.

Implementation

Lua retains original choice objects, query matching, plugin callbacks, and action execution. Swift handles rendering, input, keyboard navigation, editing shortcuts, cancellation, and focus.

The newline-delimited JSON bridge acknowledges full snapshots and coalesces pending updates to avoid dropped hs.task:setInput writes. Session/revision/input counters reject stale results and selections. Completion waits for the native panel to hide; plugin callback errors cannot disable streaming. Reload cleanup preserves the existing window-state persistence callback.

The final simplification pass unifies native/programmatic queries, avoids rematching on display-only changes, and skips hidden-window rendering. API coverage and remaining compatibility gaps are documented in vendored/Launcher.spoon/README.md; this is intentionally not full hs.chooser parity.

Setup

Stow the Hammerspoon package, then:

make -C ~/.hammerspoon native

Reload Hammerspoon and press Cmd+P. Compilation requires Apple Command Line Tools with a macOS 26+ SDK. Runtime uses glass on macOS 26+ and a visual-effect material on macOS 13–25. Generated binaries remain ignored.

Validation

  • Build both native helpers and validate Swift formatting.
  • Run chooser adapter, Launcher engine, and toast wrapper tests.
  • Run window-manager state tests: 21 passed, 0 failed.
  • Exercise native protocol readiness, snapshots, acknowledgements, malformed-input recovery, EOF exit, and process cleanup across Hammerspoon reload.
  • Manually exercise typing, calculator results, selection/metadata dispatch, standard text editing, focus behavior, and visual refinements on the current macOS host.
  • Run make format and pre-commit on all changed files.
  • Audit the staged diff for credentials, private URLs, generated binaries, and machine-specific state; unrelated working-tree changes are excluded.
  • Full make lint: existing unrelated bash/.bash_profile formatting issue and missing local shellcheck block the shell hooks. Other full-repository hooks and all changed-file hooks pass.
  • Visually validate the macOS 13–25 material fallback on an older host.

@cmpadden
cmpadden merged commit 0e363f1 into main Oct 28, 2026
1 check passed
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