Skip to content

Instantly share code, notes, and snippets.

@rbstp
Last active September 1, 2026 19:58
Show Gist options
  • Select an option

  • Save rbstp/632e12c3125f80bdec4f8240b205f5dc to your computer and use it in GitHub Desktop.

Select an option

Save rbstp/632e12c3125f80bdec4f8240b205f5dc to your computer and use it in GitHub Desktop.
Focus follows mouse for macOS, in the spirit of Hyprland's follow_mouse. One permission, no Screen Recording, and a menu bar switch. #macos #swift #hyprland #omarchy

Omarchy ruined clicking to type, so I wrote focus follows mouse for macOS

Omarchy is what did it. Hyprland hands keyboard focus to whatever window the pointer is over, no click, and you stop thinking about it inside a day. Back on macOS I was clicking a window before typing into it again, every single time.

github.com/rbstp/heed

brew install --cask rbstp/tap/heed

That is the whole setup. Grant Accessibility when macOS asks and it runs as a login agent, no Dock icon and no window of its own. A menu bar cube switches it off, ⌃⌘H does the same from the keyboard. macOS 14 or newer, Apple Silicon, MIT.

Knowing when to leave you alone is the whole job

Following the pointer is the easy part. Almost all of the work went into the moments where focus must not move, because getting those wrong makes the idea unusable rather than merely annoying.

Type a sentence and let the mouse drift over another window. The rest of the sentence stays where you started it. Focus also holds still while a mouse button is down, while a menu or a drag image is on screen, while you are in a password field, and while ⌘ is held for Cmd-Tab. Open a new window and it keeps focus until you actually come to rest somewhere else, so you can walk over to it across two displays without losing it to everything you cross on the way.

It stops sampling when the pointer stops, which is what keeps it off your battery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment