Using Dockutil with Outset to set user Docks on a Mac

Many people will find Dock Master a good tool to distributing docks to users. If you would prefer to use Dockutil with Outset and a login-once (or login-every) script, you may run into this issue:
Items are added but not always removed

Workaround #1

kcrawford (developer of Dockutil) has a workaround for this:

# Wait for a default dock
while ! /usr/local/bin/dockutil –list | grep Messages
do
/bin/sleep 1
done
# actual dockutil dock modifications here
# /usr/local/bin/dockutil –add …

I’ve found that (at least in El Capitan), you can do fractions of seconds in sleep, so

/bin/sleep .25

works, and I’d recommend it. Either way, you may still have to wait a little bit before the Dock refreshes.

Workaround #2

I did quite a bit of experimenting (with the latest Dockutil and the latest El Capitan), and the way I got a login script with Dockutil to work is to

/usr/local/bin/dockutil –remove all

remove everything on the Dock, and then do individual additions

/usr/local/bin/dockutil –add ‘/Applications/NAMEOFAPP.app’ –no-restart

until you get to the last item and then do

/usr/local/bin/dockutil –add ‘/Applications/NAMEOFAPP.app’ –no-restart

This will refresh the Dock twice, but that seems to be what works. If you do a –no-restart after the first command, you may not get everything actually removed.


Posted

in

by

Tags:

Comments

2 responses to “Using Dockutil with Outset to set user Docks on a Mac”

  1. […] example, let's say you want to deploy a default Dock to clients using Outset. The old (now frowned-upon but still works) way to do it would be to modify the […]

  2. […] example, let's say you want to deploy a default Dock to clients using Outset. The old (now frowned-upon but still works) way to do it would be to modify the […]

Leave a Reply

Your email address will not be published. Required fields are marked *