Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Dockutil

joelreid edited this page Mar 17, 2017 · 3 revisions

Dockutil

One of the more popular uses of Outset is to bundle login-once scripts in conjunction with Dockutil, a command line utility for managing the OS X dock at the user level.

Because Outset runs login-once scripts in the context of the current user, and not root, some of the advanced features of Dockutil, such as using the --all-homes argument, will not work. Any changes you make with Outset's login-once will only affect the currently logged in user.

A basic use case for Dockutil would be to remove all the items from the default dock and replace them with Applications of your choice. Here's an example of such a script that is compatible with Outset's login-once context:

#!/bin/bash

# set to the path of dockutil
dockutil="/path/to/dockutil"

# Delete everything from the dock and replace it with a specific
# selection of apps.
${dockutil} --remove all --no-restart
sleep 2 # we add a delay so that the dock has time to inialize the removal
${dockutil} --add /Applications/Safari.app --no-restart
${dockutil} --add /Applications/TextEdit.app --no-restart
${dockutil} --add /Applications/Chess.app --no-restart
${dockutil} --add /Applications/Utilities/Terminal.app --no-restart
${dockutil} --add /System/Library/CoreServices/Applications/Screen\ Sharing.app --no-restart
${dockutil} --add '/Applications' --view list --no-restart
${dockutil} --add '~/Downloads' --view fan