Open source

Your Focus already silences your phone. Now it silences your menu bar.

You flip Do Not Disturb before a deep block, the way you have a thousand times. The phone goes quiet. Every device you own agrees that you are working. And the clock in the corner of your own Mac keeps counting, which is the one interruption nobody ever gave you a switch for. Nocturne is that switch, and you do not have to touch it: turn a Focus on anywhere in your ecosystem and your menu bar goes with it.

Free and MIT. macOS 14 or later, universal, and it asks for no permissions at all, the Focus feature included. Signed with a Developer ID and notarized, so it opens on a double click with no Gatekeeper warning. Or brew install --cask dotcomjack/tap/nocturne.

Why it exists

The number was making the call, not my body.

I work a day job and build at night. What I kept noticing is that the thing ending a session was almost never actually being tired. It was catching the clock in the corner, reading 2:14 AM, and something in my head deciding that was that.

So I went to turn the clock off, and found out you cannot. That was surprising enough that I kept pulling on it. Most of the work after that was measuring which of the dozen "just run this defaults command" answers still do anything on current macOS. Almost none of them do, which is the part of this worth reading even if you never install the app.

It is a small thing. It removes one specific interruption that was reliably costing me the back half of my good hours, and I wanted it to exist, so I built it.

Jack

Follow Focus

Turn on Do Not Disturb on your phone. Your Mac goes dark too.

Focus is already the thing you flip when you want the world to leave you alone, and it already syncs across everything signed into your iCloud account. Nocturne hooks into it, so the switch you were already pressing now does one more useful thing.

It is a Focus filter, which means it lives where macOS puts these rather than in a settings pane of mine. System Settings, Focus, pick a Focus, Add Filter, Nocturne, choose a mode. Set it on Do Not Disturb only, or on Work and Sleep too, whichever ones you actually want it for. Start that Focus and the menu bar goes. End it and the mode you were on comes back.

It costs no permission at all. Not Full Disk Access, not Accessibility, not Screen Recording, not a Focus prompt. macOS hands the event to Nocturne the same way it hands it to Mail and Safari. Measured, 18ms from the system recording the Focus to Nocturne's code running.

It gives the mode back, and it knows when not to. The mode you were on before the Focus is remembered across a quit or a crash, because the app can be killed while a Focus is running and you should still get your own mode back. But if you pick a different mode by hand while the Focus is on, it leaves your choice alone. An automation that yanks the wheel back the second your Focus ends is worse than no automation.

Worth stealing

The two obvious ways to build this are both wrong.

This cost a full rewrite, one day before shipping, and none of it is in Apple's documentation. If you are building anything that reacts to Focus on macOS, these are the three things worth knowing.

  • Reading the Do Not Disturb store needs Full Disk Access.

    It is the answer every search result gives. ~/Library/DoNotDisturb/DB/Assertions.json is plain JSON, it names the exact Focus, and the first version of this feature used it. That directory is TCC protected. The identical binary reads it from a terminal and gets EPERM as a real app, because Terminal already holds the permission. That is the same trap this page documents below for kCGWindowName, walked into a second time in the same codebase. A clock utility asking for Full Disk Access is absurd, so the whole approach was thrown away.

    Launched asFocus state
    bare binary from Terminalreadable
    .app via opendenied, EPERM
  • Apple's public Focus API lies when it is not authorised.

    INFocusStatusCenter prompts for permission, and it reports one optional boolean, so it can never tell you which Focus is on. Worse, unauthorised it does not fail. Polled every two seconds while Do Not Disturb was genuinely on, it returned false every single time. A silent wrong answer is worse than an error.

  • A Focus filter cannot tell you the Focus ENDED, unless you make the parameter optional.

    Apple's own dialog promises that selected apps are notified when the Focus turns on or off, and nothing says how to tell those apart. Both arrive as the same call with the same values. Make the parameter optional and the deactivation arrives as nil. That is the only signal there is, and it is the reason the mode comes back when your Focus ends. macOS also makes that call twice per change, 588ms apart, so whatever it does has to be safe to run twice.

The finding

You cannot hide the macOS menu bar clock.

The clock is the one menu bar item Apple gives no visibility toggle. In System Settings under Menu Bar, Siri, Spotlight, Wi-Fi, Bluetooth, Battery and AirDrop all have a checkbox. Clock has a Clock Options button and nothing else.

Measured on macOS 26.3.1 by reading the on-screen width of Control Center's clock window before and after each write, rather than by trusting a blog post:

ApproachClock width
Baseline, Sat Aug 8 2:43 AM142pt
defaults write com.apple.controlcenter Clock -int 8142pt, no effect
defaults write com.apple.controlcenter "NSStatusItem VisibleCC Clock" -bool false142pt, no effect
defaults write com.apple.menuextra.clock DateFormat -string " "142pt, no effect
defaults write com.apple.menuextra.clock IsAnalog -bool true44pt

So the trick is not to hide the clock. It is to make it unreadable. An analog dial at 44pt still tells the time, in the sense that a sundial in the next room tells the time. Your eye stops catching it, and nothing is hidden, moved or drawn over.

Modes

Five, and the default is the safe one.

  • Clock visible

    The normal macOS clock. Nothing is touched.

  • Blind

    An analog dial. The time is still there, you just cannot read it. This is the default, and it is one Apple preference key, so nothing about it can break.

  • Gone

    A patch drawn over just the clock. Experimental, and it leaves a faint seam.

  • Hide everything

    The whole menu bar goes blank, except Nocturne's own icon so there is a way back. Clicks still pass through, so the Apple menu and app menus keep working. You just cannot read them.

  • Only the clock

    Everything but the clock goes blank. Hide everything turned inside out, for whoever's problem is the twenty icons rather than the time. The strip stops at the clock's left edge, and nothing is drawn to its right because, measured, there is nothing there: the clock's window runs to the screen edge. It leaves one seam, where the strip stops, and it is the one covering mode that leaves the clock digital. Added in 1.4.0, and offered to Focus filters too.

Hover to show, added in 1.2.0, hands the bar back on demand. Turn it on and the cover drops away while the pointer is on the menu bar, then comes back when the pointer leaves. So you can read the time by going to look for it, which is a deliberate act, rather than by changing a mode and then remembering to change it back.

Off by default, and offered in the three covering modes, Gone, Hide everything and Only the clock. Blind hides the time by writing Control Center's own preference, and undoing that costs a Control Center restart, which is far too slow to spend on a hover. It still costs no permission: macOS gates key events behind accessibility and leaves mouse events alone.

Another trap

The window list has one too.

kCGWindowBounds is free to read. kCGWindowName is gated behind Screen Recording. An early version of the locator filtered menu bar windows by name and appeared to work perfectly, because it was being launched from a terminal and inheriting that terminal's permission. Launched normally as an app it returned nothing, silently.

Launched asWindows with a readable name
Bare binary from Terminal10
.app via open0

So Nocturne identifies the clock by where it sits, never by what it is called. If you test anything against the window list, test it as a real app bundle and not from your shell.

Limits

What it does not do.

  • Gone leaves a faint seam. The Tahoe menu bar is translucent over your wallpaper, so any window drawn above it blurs an already-translucent layer and lands darker. Eight materials were measured against a live bar; the closest still sits 36.7 away. An exact match would mean sampling real screen pixels, which costs a Screen Recording prompt, and a clock utility has no business holding that permission.

  • Restoring always lands on a digital clock. Nocturne's own preferences can be cleared while the clock is analog, and treating that as your original would restore you to analog permanently. If you were already running the analog clock before installing, you get a digital one back.

  • macOS 14 and 15 are compiled and symbol-checked but have never been run. Every API and SF Symbol used resolves to macOS 13 or earlier, and the deployment target is 14.0, but the only machine this has actually run on is macOS 26.

  • Follow Focus is configured in System Settings, not in Nocturne. That is the trade for it costing no permission: it is a Focus filter, so macOS owns the setup, and you add it per Focus under System Settings, Focus, Add Filter. There is no in-app switch on purpose, because two switches that can disagree is worse than one.

  • It does not manage other menu bar items. Hide everything and Only the clock blank the whole bar, but for per-icon control, ordering and hidden sections, that is Ice, which is excellent and does it properly.

  • It does not cover a display whose current Space is a full-screen app unless the menu bar is set to stay visible there. With the default setting the bar slides away in full screen and there is nothing to cover, so the strip stays out of that Space on purpose and never floats over a video. Set the bar to stay, Never or On Desktop Only, and that display is covered like any other, measured with Safari full screen on an external panel. Since 1.4.1.

If you build something on this, or you fixed something I got wrong, I want to see it. My inbox is open: jack@dotcomjack.com. I read and answer everything myself.

Also built

  • Know which Claude Code session needs you. Tints each terminal window by project and brightens the one that finished.

  • A Claude Code skill for dispatching parallel subagents, standalone, with no framework to adopt.

Everything on the shelf

Here's to the crazy ones. The misfits. The rebels. The troublemakers. ... Because the people who are crazy enough to think they can change the world, are the ones who do.

Apple, Think Different, 1997
d o t c o m j a c k
DotcomJack · Detroit, MI · jack@dotcomjack.com