Skip to content

feat(darwin): redesign and harden desktop automation - #375

Open
atyrode wants to merge 38 commits into
mainfrom
harden/macos-automation
Open

feat(darwin): redesign and harden desktop automation#375
atyrode wants to merge 38 commits into
mainfrom
harden/macos-automation

Conversation

@atyrode

@atyrode atyrode commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the former SketchyBar shell layout with the DATUM Lua/SbarLua instrument bar and its native menu-bar handoff
  • retire Karabiner and Hammerspoon from the active stack; preserve printable keyboard layout with a native hidutil Caps Lock mapping
  • package pinned skhd.zig, strip its optional root grabber, copy it to a stable app identity, and sign it with a host-local trusted certificate
  • replace the general-purpose Hammerspoon runtime with a narrow compiled Objective-C bridge for pointer/menu, battery, Wi-Fi, and volume events
  • add immutable automation configuration, least-privilege runtime checks, signing bootstrap, TCC review receipts, dependency/update guards, and operator documentation

Verification

  • nix flake check --print-build-logs on x86_64-linux: all checks passed
  • nix build .#checks.x86_64-linux.window-management .#checks.x86_64-linux.atyrode-cli: passed
  • nix build .#packages.aarch64-darwin.skhd .#packages.aarch64-darwin.macos-automation-bridge: passed on the target Mac
  • atyrode apply alex-aarch64-darwin --repo /Users/alex/nix-dotfiles: passed
  • signed skhd and automation bridge LaunchAgents are running from the stable managed-app directory
  • reversible hotkey smoke test switched Space 4 → 3 → 4 through the live skhd right-Control bindings after the privacy reset and daemon restart
  • automation doctor reports SIP enabled, scripting addition disabled, no forbidden processes, Hammerspoon absent, valid identities/versions, no unexpected TCP listeners, and immutable config

Manual review still required

The TCC receipt is intentionally absent. The CLI requires a real System Settings privacy review before atyrode tcc-review --acknowledge; this session could not inspect the UI because the managed orca desktop CLI is unavailable on the Mac (orca: command not found). The code and runtime checks are complete, but this security/deployment PR should be held until that review is performed.

atyrode added 30 commits August 9, 2026 12:47
Replace the vendored FelixKratz shell tree with a first-party Lua
configuration on the SbarLua runtime (resident process, direct mach IPC,
in-process sketchybar-app-font ligature table -- no fork-per-event).

Design per operator direction, pixel-audited iteratively on-device:
- solid Rio-background bar, 38px: 26px chips with 6px air above/below
  matching the inter-chip gaps; yabai reserves exactly that height
- left side reserved for Space management: per-Space chips 1-9, focused
  chip solid teal with dark content, app-icon ligatures never hide,
  unmapped apps get a pinned override (Rio, Orca) or the :default: tile
- space_eager fast-highlight and yabai signal-driven settle retained
- right of notch: fused moon-phase + weather pair (keyword-matched
  filled MD moon glyphs; condition-aware weather glyph; single ipinfo
  call), breathing room off the notch
- far right: dotfiles-drift widget (dirty/ahead/behind, no network),
  volume, always-visible battery, clock
- Spotify chip on its own PlaybackStateChanged distributed notification
- menubar duck: bar slides down while native menus are open
  (HIToolbox begin/endMenuTracking) -- verified live
- front_app chip dropped (operator: spaces + icons suffice)

Infra: JetBrainsMono Nerd Font installed; lua5_5/curl/git join the
service PATH; HM deploys the tree plus a generated bootstrap that pins
SbarLua/app-font/Lua store paths; keyboardtype activation script
registers the Karabiner virtual keyboard as ISO (41) so the French
layout stops swapping @ and <; treefmt gains stylua and drops the
vendored-tree exclusions; checks rewritten against the Lua contracts
(height/reservation lockstep, eager path, no-collapse guard, palette
pin, required/forbidden events).
Round of live direction on the redesign branch, each item pixel-audited
or query-measured on-device:

- Space pills: real macOS app icons (background.image = app.<Name>)
  replace all glyph-font mapping; sketchybar-app-font dependency gone
- bracket geometry measured: member padding is pill-interior, so
  dedicated spacer items carry the uniform 6px inter-chip gap
- focused window title revealed after the Space cluster
- icon slots: inherited 1px chip border zeroed (read as boxes)
- weather chip absorbs the moon phase as a trailing emoji glyph
- volume rebuilt as one pill: icon, expanding slider track, percentage
- dotfiles-drift widget removed, front_app removed (operator verdicts)
- menubar duck covers menu tracking (verified) and hover reveal via
  Hammerspoon eventtap (pending the operator's Accessibility grant)
- Hammerspoon joins the stack: cask + app-bundle launchd agent +
  HM-deployed init.lua with the hover watcher
The slider knob draws even at track width 0 and parks over the
percentage label (operator screenshot). Knob visibility now follows
the expanded state.
Operator direction. SketchyBar cannot alpha-fade background.image app
icons, so the bar hides instantly and macOS's own menu-bar fade-in
provides the crossfade. Verified live via menu tracking: hidden=on
while a menu is open, off after.
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