nanobar
A lightweight macOS menu bar manager. Hide menu bar icons without needing a full app like Bartender or Ice.
nanobar works by creating an invisible NSStatusItem divider in your menu bar. When activated, it expands to 10000pt, pushing everything to its left off-screen. This is the same technique used by Bartender and Ice — no private APIs, no SIP disabling, no accessibility permissions.
Install
Requires macOS and Rust toolchain.
Usage
nanobar <command>
Commands
| Command | Description |
|---|---|
list |
List all menu bar items with their positions |
start |
Start the daemon (adds a › divider to the menu bar) |
hide [apps...] |
Hide items to the left of the divider |
show |
Show all hidden items |
stop |
Stop the daemon and remove the divider |
status |
Show current daemon state and item visibility |
install |
Install launch agent for auto-start at login |
uninstall |
Remove launch agent |
Examples
Start the daemon — a › divider appears in your menu bar. Drag it to choose where to split visible/hidden items:
Hide everything to the left of the divider:
Hide specific apps (moves the divider automatically):
You can also reference items by their number from nanobar list:
# App PID Window X W
Show all hidden items:
Stop the daemon and remove the divider:
Auto-start
To have nanobar start automatically at login:
This creates a LaunchAgent at ~/Library/LaunchAgents/nanobar.plist. To remove it:
You can also toggle this from the right-click menu (see below).
Click to Toggle
The divider works as a toggle button:
›(visible state) — click to hide items to its left‹(hidden state) — click to show all items
Right-click Menu
Right-click the divider to open a context menu:
- Start at Login — toggle auto-start (shows ✓ when enabled)
- Quit — stop the daemon
How It Works
nanobar startspawns a background daemon that creates anNSStatusItemdivider (›) and an invisible pusher item- The divider's position is persisted via
NSStatusItem.autosaveName, so it survives restarts nanobar hide(or clicking›) tells the daemon to expand the pusher to 10000pt, pushing left-side items off-screen, and changes the divider to‹nanobar show(or clicking‹) collapses the pusher back and restores the divider to›nanobar hide <apps>reads each app's savedNSStatusItem Preferred Positionfromdefaultsand repositions the divider accordingly
The daemon communicates with the CLI over a Unix socket at /tmp/nanobar.sock. AppKit calls are dispatched to the main thread via dispatch_async_f.
Requirements
- macOS (tested on macOS 15 Sequoia)
- Screen Recording permission (for
nanobar listto read window info viaCGWindowListCopyWindowInfo)
License
MIT