Skip to content
Anthony Reimer edited this page Nov 20, 2024 · 5 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 macOS 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 /System/Cryptexes/App/System/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

A more advanced example is available in the setDock-defaultDockOutset.sh script (from a set of scripts authored by Mischa van der Bent and extended and adapted for Outset by Anthony Reimer).