Spaced Out

I’ve just discovered how to space out the apps in my dock on my mac. I’m unnecessarily excited about this so I thought I’d blog.

So there I was, minding my own business, watching a pretty tame screencast about favicons and browser support when BOOM! The guy presented had managed to space out apps on his dock (yes this post is Mac specific). What kind of voodoo was this?

This is how I’ve arranged my dock with my new found power

A quick google landed me at this blog post, which told me all I needed to know.I opened up a terminal window, tried out the suggested code and just like that, I had empty places on my dock to play with.

$ defaults write persistent-apps -array-add '{"tile-type"="spacer-tile";}'

You need to restart the dock before the addition of space takes effect.

$ killall Dock

Neat as this was, I have a habit of forgetting handy tricks like this. I’ve taken to adding shortcuts to my ~/.bash_profile file to give me the best chance of using all the quirky tricks I find on the www. This file is basically a list of bash commands run each time you open a new terminal window, ideal for defining aliases (command line shortcuts). Here’s what you need to do to speed up this particular workflow:

Open up a terminal window and head to your ~/.bash_profile file. If the file doesn’t already exist, this will create one in the right place. (Here I’m assuming you have vim installed – nano

$ vim ~/.bash_profile

Once inside the file, add this code and exit (in vim that’s qw to write to file and quit).

# shortcut for adding empty space to dock
alias dockspace="defaults write persistent-apps -array-add '{"tile-type"="spacer-tile";}';killall Dock"

You’ll have to close and reopen your terminal window, but from no on, whenever you need to add a space to your dock, the command alias $ dockspace will do it all for you. You can drag it around the dock like you would with any other icon. To remove the space just pull it off the dock. Neat huh?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s