Article URL: https://github.com/cabeen/zen-mode Comments URL: https://news.ycombinator.com/item?id=48884663 Points: 10 # Comments: 4

A small tool to reclaim my attention - providing a global focus mode across macOS apps. My screen is always full of things asking for it: other windows, notification badges, the Menu Bar clock, the Dock, a scenic wallpaper. Zen Mode is one hotkey that silences all of it. The window I'm working in glides to the center of the screen and stretches to full height, and everything else — Menu Bar and Dock included — fades to black. Press the hotkey again (or Esc) and everything returns exactly where it was. It's like full-screen mode, except your window keeps its natural width — more like a spotlight than a takeover. It's a Hammerspoon script, not an app, and it works on every Mac app: unlike the zen modes built into individual editors, the same keystroke works in your terminal, your browser, a PDF reader, or anything else with a window. A busy desktop — other app windows, the wallpaper, the Menu Bar, and the Dock all competing for attention — until one keystroke centers the focused window and fades everything else to black. It works the same in a terminal, a browser, or any other app: Grant Hammerspoon Accessibility permissions (System Settings > Privacy & Security > Accessibility): Append the contents of init.lua from this repository to your ~/.hammerspoon/init.lua: Instead of resizing or hiding other apps, the script draws a single full-screen CoreGraphics canvas over everything — elevated to the cursor window level so it covers the Menu Bar and Dock — and then punches a transparent, rounded-corner hole exactly where your focused window sits. Your window stays a completely normal, interactive window; everything around it is simply blacked out. What this script does differently is combine those pieces into one deliberate, reversible gesture that works on any window: a single hotkey centers the window at full height, blacks out everything else on screen — wallpaper, Menu Bar, and Dock included — in one synchronized animated transition, and puts the window back exactly where it was when you leave. It's also not an app: it's ~250 lines of dependency-free Lua you can read in a few minutes and tweak to taste.