Dock settings

akime9
New Contributor

Hello right now I have the dock set via config profile. The users are able to add items just two things are unremovable. I want to switch to dock utility instead of config profile. The question is can I run a script to backup what their current dock is, remove the config profile and the apply this backed up dock?

1 REPLY 1

bigben54
New Contributor III

dockutil has a list feature, just use --list to get a tab separated list for the current user, or add options for other or all users. Check the usage details on GitHub or run 'docktutil -h'

 

# list current users dock, returns tab separated list
% dockutil --list

/* 
example output
Launchpad	file:///System/Applications/Launchpad.app/	persistentApps	/Users/thisuser/Library/Preferences/com.apple.dock.plist	com.apple.launchpad.launcher
Google Chrome	file:///Applications/Google%20Chrome.app/	persistentApps	/Users/thisuser/Library/Preferences/com.apple.dock.plist	com.google.Chrome
...
Downloads	file:///Users/thisuser/Downloads/	persistentOthers	/Users/thisuser/Library/Preferences/com.apple.dock.plist
*/

# list specific users dock
% dockutil --list /Users/thatuser

# redirect to file for use when rebuilding
dockutil --list /Users/thatuser > /tmp/thatuser.dock.txt