We’d like to deploy our M2 Macs with a pre-configured set of applications in the dock, but we don’t want to restrict users from moving or resizing the dock. Is there a way to set specific apps in the dock without fully locking it down for the end user?
Yeah, I tried that, but I couldn’t get it to add the apps I wanted to the dock or position them how I wanted. I also tried some scripts, but the results weren’t what I was expecting.
Hi @clauss! We’re here to help you with the issues you’ve encountered. You can customize your dock using Terminal commands, and these commands can be executed remotely on your devices through Hexnode’s Live Terminal feature.
First, check if Homebrew is installed by running:
check brew version
1
brew--version
If it returns a version number, you’re good! If not, you can install it with:
Then, check Homebrew again with the following command. It will return the installed Homebrew version:
check brew version
1
brew--version
Next, you’ll need to install dockutil:
Install dockutil
1
brew install dockutil
To confirm the installation, run the following command:
check dockutil version
1
dockutil--version
Once you’ve got Homebrew and dockutil installed, run this script to set up your dock. If you’ve got a lot of devices, you can push the script through Hexnode’s Execute Custom Script action. For just one or a few devices, you can run it directly in the Live Terminal.
Dock customization script
1
2
3
4
5
6
7
8
9
10
# Clear all existing dock items (optional)
dockutil--remove all
# Add default applications to the dock
dockutil--add"/System/Applications/Launchpad.app"
dockutil--add"/Applications/Safari.app"
dockutil--add"/Applications/Messages.app"
dockutil--add"/Applications/Mail.app"
dockutil--add"/Applications/Calendar.app"
dockutil--add"/Applications/YourCustomApp.app"# Add custom app as needed
echo"Dock setup completed."
Just adjust the app paths and order in the script to suit your needs. This will set up the dock, and users will still be able to move or rearrange the apps afterward.
Hope that helps! Let me know if you have any other questions.