Benjamin Sago / ogham / cairnrefinery / etc…

Technical notes Put gaps between stuff in macOS

I like to add gaps to the items in the Dock and the menu bar. This means that when I’m trying to find something using the mouse or the trackpad, I can optimise the search by first finding the “clump” that it’s in, and then searching within that clump.

Adding spaces to the Dock

Run this command to add a space to the end of your Dock:

defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'

You’ll need to killall Dock to get it to appear. Once it’s there, you can drag it around as you would any other app.

A screenshot of my Dock, with a bunch of gaps in.

I’ve got one clump of icons for programs I have open all the time, one clump for my regular development tools, one clump for “productivity” tools I use slightly less regularly, one for entertainment stuff like music or photos, and one last gap at the end to separate the applications that live in the Dock from those that don’t.

I also have this Specsheet check to remind me to do it when setting up a new machine:

spec/dock.toml
[[cmd]]
name = "The dock has spacers in"
shell = 'defaults read com.apple.dock persistent-apps'
stdout = { string = 'spacer-tile' }

It doesn’t check the entire contents of the Dock, merely that it has a space in, which is enough of a reminder for me.

Adding spaces to the Menu Bar

To separate things in the Menu Bar, I use the amazing Menu Bar Splitter utility.

A screenshot of my menu bar, with a bunch of gaps in.

I’ve got one clump for the date and time, one clump for sound (wireless headphones connection and volume), one clump for system stats (CPU, RAM, and network usage), and one last clump for everything else.