How to Use the Command Line to Make the Dock Appear Faster on Your Mac

| How-To

The Dock in OS X can be set to always be visible, or it can be set to appear only when you mouse over its location on the edge of your screen. There's a delay, however, between when you mouse over the edge and when the Dock actually appears, and some folks don't care for that. It turns out you can change this behavior.

Mac Geek Gab listener Dan Grondin sent us a tip. It involves the command line on your Mac, but thanks to the magic of copy-paste, it's still very easy to do. From Mr. Grondin:

My life is full of joy since i learned how to reduce the time it take to see the dock popping to existence when the cursor hit the edge of the screen (i want it as fast as possible).

Fair enough, Mr. Grondin!

First, you'll want to set your Dock to auto-hide. You can do so in System Preferences -> Dock, as shown below.

El Capitan System Preferences -> Dock preferences

El Capitan System Preferences -> Dock preferences

Next, type or copy-paste the following into the Terminal in OS X:

defaults write com.apple.dock autohide-time-modifier -int 0 && Killall Dock

Terminal Command

Terminal Command

What that command does is create (or modify, if it's already been created) a preference file that tells OS X how long to take when displaying the Dock. In this case, the wait is 0, as in instantaneous. The Dock is there and then not there the moment your mouse/trackpad hits or leaves the edge of your screen.

The last segment of that command—"&& Killall Dock"—is telling your Mac to quit and restart the Dock process. It can also be run on its own line without the two ampersands.

You can make that value any number you want, so if you're the type who wants the Dock to appear more slowly, you can make it a higher number. At 10, it takes about 3 seconds total for the Dock to appear, maybe a bit longer. At 100, you can watch it happen frame by frame over the course of about 28 seconds. A value of 0.5 make an instantaneous appearance, without animation, after a split second's delay.

I believe the default value is 1, which is less than a second. If you want to go back to the way Apple intended it, you can either add in that value by hand, or use the following command to remove the preference file altogether:

defaults delete com.apple.dock autohide-time-modifier && killall Dock

Terminal Command

Terminal Command

And that's it! You can tweak your Dock's appearance and disappearance until your heart's content.

Comments

oneof52

How can you make the Dock stay on one screen?  I have 2 displays on my Mac Pro.  I want the dock fixed to the bottom of the left screen.  I have the dock always displayed (doesn’t disappear).  Occasionally, when I’m on the right monitor. the dock jumps to the right.  I play hell trying to get it to go back to the left screen.  Tapping anywhere I can on the left to get it to move back.  Anyway to dock the dock on one monitor only?

Old UNIX Guy

oneof52,

What version of OS X are you running?  I think things changed a bit between Yosemite and El Capitan.  But the dock should display on your primary monitor.  I’d go into System Preferences -> Displays with the 2nd monitor hooked up and see what it says is the primary display.  HTHAL…

MOSiX Man

Cool tip. Thanks, Bryan.

Scott B in DC

Note that the double ampersand (&&) means to run the next command iff the previous command returns “TRUE” or a value of zero (0). This means that the killall command will not run if the defaults command fails.

There are a few reasons why the defaults command will fail, but if you’re writing a single line command from the terminal and do not anticipate fat-fingering the command (I do all the time but don’t care), then you can save a keystroke or two by just separating them with the semicolon (;).

Remember, there are reasons why Unix commands are short… we programmers hate to type more than we have to. If we can save a couple of keystrokes then we’ll do it!!

Log in to comment (TMO, Twitter or Facebook) or Register for a TMO account