How To

Unlock the macOS Dock’s Hidden Secrets in Terminal

Posted on August 22nd, 2017 by

Unlock the macOS Dock’s hidden secrets in Terminal

Elsewhere on this blog, we help you get to know your Mac’s Dock. But it turns out Apple only provides settings for some of the Dock’s tricks – many are effectively hidden secrets.

Fortunately, you can get at these bonus extras by way of a quick trip to the Terminal app, and some deft typing – or by copying and pasting the various commands outlined below. A few of these settings are, admittedly, little more than curiosities, but some make the Dock significantly more useful.

Back-up existing Dock settings

Before making major changes to your Dock settings, back-up your existing ones, in case you want to put them back later.

In Finder, hold Option and click Go, and then select Library. In the Finder window that appears, open the Preferences folder, and make a copy of com.apple.dock.plist. (You can do this by Option-dragging it to another folder.)

Back-up existing Dock settings

To later reinstate this version of your Dock’s preferences, copy the file back to the aforementioned Preferences folder, replacing the one that’s there. Then open Terminal, and use the following command to restart the Dock:

killall Dock

Press Return and your Dock will be back as it was before you made any changes.

Now we’ll delve into how to make it a little bit different…

Add macOS Dock spacers

When you’ve got loads of items stashed in your Dock, visually separating them into groups of related apps can be useful. For each run of the following command, a ‘spacer’ will be added to the apps side of the Dock:

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

Each individual spacer can be moved in the Dock by click-dragging it.

Add macOS Dock spacers

To remove a spacer, either Control-click and select Remove from Dock, or drag it away from the Dock and let go of the mouse/trackpad button.

Create macOS Dock recent items stacks

Run the following command, and you get a recent items folder in the documents side of the Dock:

defaults write com.apple.dock persistent-others -array-add '{"tile-data" = {"list-type" = 1;}; "tile-type" = "recents-tile";}'; killall Dock

By default, this will show ten recent applications in the Grid view.

Create macOS Dock recent items stacks

This number can be adjusted in the General section of System Preferences, using the Recent items menu.

Configure your recent items stacks

Control-click on the stack and under View content as you can change its view type (from Automatic to Fan, Grid, or List). More importantly, you can at the top of the menu adjust the type of content the stack houses, from applications to recent documents, recent servers, favorite volumes, or favorite items.

If you want multiple recent-items stacks – perhaps one for applications and another for documents – just run the Terminal command several times, and configure the stacks accordingly. Again, these stacks can be removed from the Dock like any other item.

Configure your recent items stacks

Another – rather more minor – stacks command is also available:

defaults write com.apple.dock mouse-over-hilite-stack -bool yes; killall Dock

This highlights the item under the cursor, mirroring the selection highlight seen in stacks when you navigate them using the keyboard. Running the command with no instead of yes reverts the setting to macOS defaults.

Have the Dock show only active apps

Rather than using the Dock to stash loads of app shortcuts, you can turn it into something resembling a focused app-switcher with the following command:

defaults write com.apple.dock static-only -bool true; killall Dock

After running this, the Dock will only display apps that are currently running. Essentially, this mirrors the Mac app switcher, albeit with items being displayed in the order they were launched, not in terms of recent usage. Switching the true value to false reverts.

Have the Dock show only active apps

Activate the Dock’s single-app mode

Click on an app icon in the Dock, and the app’s windows come to the front – unless the app’s in full-screen mode, in which case you switch to it. If you fancy more focus on your Mac desktop, but without full screen, run this command:

defaults write com.apple.dock single-app -bool true; killall Dock

Now when you click an app icon in the Dock, the app’s windows will still come to the front, but every other app will be hidden. If you want to see two apps simultaneously, you can still do so by switching to them using the Command+Tab app switcher. Again, switching the true value to false in the command reverts.

Highlight hidden apps in the Dock

Although the Dock can differentiate open apps by way of displaying a black dot beneath them, it also has the capability to show which apps are hidden. Run the following command:

defaults write com.apple.Dock showhidden -bool yes; killall Dock

The next time you hide any app, its icon in the Dock will become semi-transparent.

Highlight hidden apps in the Dock

To change this back to macOS defaults, switch yes for no in the command.

Alter the Dock’s appearance

There are a few Terminal commands that go beyond the Dock System Preferences pane in terms of changing how the Dock looks.

This first one activates the ‘suck’ minimization effect, which is a halfway house between ‘genie’ and ‘scale’:

defaults write com.apple.dock mineffect -string suck; killall Dock

To switch to a standard macOS effect, use System Preferences as normal, or replace suck in the command with genie or scale.

Alter the Dock’s appearance

When using magnification, app icons sizes max out at 128 pixels. But using the following command, you can go up to 512 (although many app icons don’t look too hot above 256):

defaults write com.apple.dock largesize -int 512; killall Dock

You can also fine-tune the size of the Dock, beyond the range Apple provides in System Preferences:

defaults write com.apple.dock tilesize -integer 8; killall Dock

It’s possible to go all the way down to 1, which is essentially unusable without magnification. Around 48 appears to be the default size on most Macs, and 16 is the smallest setting accessible outside of Terminal.

Tweak Dock animation speeds

When the Dock hides and reappears – either automatically, or when triggered with the keyboard shortcut Command+Option+D – it takes time to do so. This time can be adjusted using the following command:

defaults write com.apple.dock autohide-time-modifier -float 1; killall Dock

1 is the standard macOS setting. Using 0 removes the animation entirely, or you can use fractions to merely speed things up a bit. You can also slow the animation down by using a higher number (such as 5), to have the Dock think it’s living out one of those slow-motion scenes from The Matrix.

It’s also possible to disable the delay before the Dock appears from being hidden, by using the following command – although the difference is subtle:

defaults write com.apple.dock autohide-delay -float 0; killall Dock

To revert this setting, use:

defaults delete com.apple.dock autohide-delay; killall Dock

Reset the Dock to its default state

At the beginning of this feature, we explored how to back up your Dock’s settings, but what if you just fancy a clean slate? If that’s you, run this command:

defaults delete com.apple.dock; killall Dock

The Dock will restart with ‘factory settings’, ready for you to experiment afresh.


New to Mac? Let's get you started on the right track!

Want to get the most out of your new MacBook, iMac or other Apple computer? Whether this is your first laptop or you’ve just switched from Windows, there are a few things you should know about your new Mac, like basic keyboard shortcuts or how to use the various features macOS has to offer. Learn more about what your Mac computer can do for you at the Intego New Mac User Center: Get started now!

About Craig Grannell

Craig Grannell is a technology writer, mostly specialising in Macs, iOS, apps, and games. He’s been immersed in all things Apple for over 20 years, and enamoured with computers since getting his hands on a VIC-20 as a kid. He also has a Korg Gadget addiction. Send help. Or alternatively, visit his website, craiggrannell.com, and follow him on Twitter at @craiggrannell. View all posts by Craig Grannell →

Sign up For Our Newsletter

Get the latest Mac security news direct to your inbox.

{"url":"\/marketo\/json\/add-to-newsletter","data":"list_name=Blog Roadblock"}