Terminal Tricks: Mastering the Iconic macOS Dock, Part 3

The macOS Dock

(The macOS Dock)

Over the past week, we’ve been showing you how to customize the macOS Dock. In the first part of this series, we took you through the many settings available in the System Preferences Dock pane. Earlier this week in the second installment, we showed you how to add folders, move, add and remove icons, and how to use Terminal to add spacers or even show only active apps in the Dock. In today’s final post, we’ll continue by describing terminal commands that complete your mastery of the macOS Dock.

All of the commands shown in this post require some familiarity with the macOS Terminal. If you feel uncomfortable with the command-line interface, you might want to stay with the many customizations made possible through the methods described in the first two parts of this series.

To start making any of the changes described here, you’ll need to be in the Terminal app. It’s located in Applications > Utilities, and can be started easily by either asking macOS Siri to “Launch Terminal” or by selecting Go > Utilities in Finder, then double-clicking the Terminal icon.

See Which Apps Are ‘Hidden’
Sometimes you may have a Dock icon for an app but can’t find any app windows associated with it. In a case like that, you have probably chosen to hide the app. This is useful when you need to have an app running, but don’t necessarily need to have a window clogging up your Mac display. As an example, I always have a webcam app running on my Mac that sends a photo to an FTP server once every minute. That app needs to be running, but I don’t need to see what the webcam is taking photos of, so I choose to hide it.

Oddly, Apple included a way to show hidden apps as “grayed out” on the Dock, but didn’t include a switch for it in System Preferences. At the Terminal prompt, enter the following command (it’s easiest to just copy & paste these commands), then press Return:

defaults write com.apple.dock showhidden -bool TRUE; killall Dock

You can see the hidden app effect on the Google Chrome and Mail app icons in the image below:

The Chrome and Mail apps are hidden, with a "greyed out" look on the Dock icons

(The Chrome and Mail apps are hidden, with a “greyed out” look on the Dock icons)

To return to the “regular” Dock icons, use the same Terminal command as above, replacing the Boolean operator TRUE with FALSE.

Change the Dock Hide Delay
In the first post in this series, we showed how you can hide the Dock when it’s not in use. There’s a slight delay built into the appearance of the Dock when the cursor is hovered over the side or bottom of the Mac display where the Dock resides; that same delay occurs before the Dock disappears again.

To change the Dock hide delay time, use the following Terminal command:

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

This particular setting doubles the amount of time in the delay, so the Dock is a bit slower in appearing and disappearing. To make the Dock hide and reappear immediately with no delay, replace the “2” in the Terminal command with “0” (zero); to return to the default delay, replace the “2” with “1”.

Turn On A Hidden Minimize/Maximize Animation
In the first post, we showed you how to switch between two animations that are used when an app window is being minimized to the Dock by clicking the yellow dot in the upper left corner of the window. The two “normal” animations are “genie” and “scale”, and it’s easy to switch between them by using System Preferences. But there’s also another hidden animation called “suck”, which makes the window disappear as it it’s being sucked into a vacuum cleaner!

Turn on the “suck” minimization effect by entering this terminal command:

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

Just a reminder; to watch the effect in slow motion, just hold down the Shift key as you click the minimize (yellow) button. Here’s what this animation looks like in action:

The "suck" animation for minimized windows

(The “suck” animation for minimized windows)

To revert to either the “genie” or “scale” animations, run the Terminal command again, replacing the word “suck” with the appropriate animation name.

Adding Custom Stacks to the Dock
In the second installment of this series, we showed how to add folders to the Dock for applications, downloads and documents. One setting turns those folders into “stacks” that show the contents of directories without opening a Finder window. Wouldn’t it be nice to have stacks that could display recently opened applications, documents or even servers?

Yes, there’s a Terminal command for that! Enter this command into Terminal:

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

After running this command and right-clicking the new stack to change it to a grid view of my recent applications, this is what I saw:

The "Recent Applications" stack viewed as a grid

(The “Recent Applications” stack viewed as a grid)

Recently-run applications aren’t the only stack available; right-click the stack icon in the Dock to view a menu display the choices. Recent Applications, Recent Documents, Recent Servers, Favorite Volumes and Favorite Items are all available with a quick menu selection (see screenshot below).

Other Dock stacks that are available

(Other Dock stacks that are available)

To delete the stack from the Dock, just drag it off the Dock and let go…

 Setting Everything Back to Defaults
If at any point during your Dock adventures you need to set everything back to the original macOS defaults, there’s a Terminal command for that as well:

defaults delete com.apple.dock; killall Dock

That command simply deletes the Dock preferences file, then restarts the Dock. However…this command also gets rid of any customizations you have made, including adding or deleting certain app icons, so be sure to use it only as a last resort.

If you have any Dock customizations that we haven’t listed in this three-part series, please let us know in the comments below and we may revisit them in a future article!


LEAVE A COMMENT


  • Whenever you feel like your work is unappreciated, count your blessings that at least you were not the engineer who wasted hours programming the OS X “suck” animation that only a handful of users will ever see.




  • Is there any way to kill the dock and resurrect it in the form of the pull down menu in the upper right hand corner of the monitor screen that was so handy in in Mac OS 9. It was out of the way, never popped up to get in the way when the cursor reached the edge of the screen. At the very least let one move it to the top of the screen as was possible in an earlier version of OS 10.




  • Like kerry I did the command,but in my case nothing actually seems to have happened, no new stack added – is there a step am missing? I just ran the command

    defaults write com.apple.dock persistent-others -array-add ‘{“tile-data” = {“list-type” = 1;}; “tile-type” = “recents-tile”;}’; killall Dock

    literally copy / pasted into terminal




  • Hi – I’ve been trying to add a “recent apps” icon to the dock with the terminal command you provided. Unfortunately, I keep getting error messages and wondered if I’m inserting spaces where they shouldn’t be – it’s hard to tell where they are from the command as it’s printed in the article. Could clarify where I should be typing spaces in the command? Thanks for your help.