We are updating the Dock on macOS devices to include apps that are frequently used by our employees. Is there a way to remove the default apps from the Dock and replace them with specific apps? We want to customize the Dock based on user preferences.
How to remove default items on dock?Solved
Tags
Replies (5)
Hey @boris ,
We had a similar issue in our organization and wanted to customize the Dock to reflect the apps our team uses most often, but first, we needed to remove the default apps on the device. You can give the below script a try to remove the default apps from the Dock.
Here’s the script we used:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
apps_to_remove=( "Safari" "Mail" "Contacts" "Calendar" "Notes" "Reminders" "Maps" "Photos" "Messages" "FaceTime" "Freeform" "Music" "Podcasts" "TV" "App Store" "System Settings" ) logged_in_user=$(stat -f%Su /dev/console) dock_plist="/Users/$logged_in_user/Library/Preferences/com.apple.dock.plist" for app in "${apps_to_remove[@]}"; do /usr/libexec/PlistBuddy -c "Delete persistent-apps:0" "$dock_plist" 2>/dev/null echo "Removed $app from the Dock" done killall Dock |
The above script will remove the default apps listed in the apps_to_remove array from the Dock on macOS devices.
Thanks for the script. Is there any way to add the applications of our own choice to the Dock?
You can check out the following script to add specific application to your Dock.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#!/bin/bash LOGGED_USER= stat -f%Su /dev/console sudo su $LOGGED_USER -c 'defaults delete com.apple.dock persistent-apps' dock_item() { printf '<dict><key>tile-data</key></dict><dict><key>file-data</key></dict><dict><key>_CFURLString</key><string>%s</string><key>_CFURLStringType</key><integer>0</integer></dict>', "$1" } app1=$(dock_item app1 path) app2=$(dock_item app2 path) sudo su $LOGGED_USER -c "defaults write com.apple.dock persistent-apps -array '$notes' '$screenshot'" killall Dock |
Replace app1 path and app2 path with the full paths to the applications you want to add to the Dock. You can add more applications using the same format.
I wanted to know if there’s a way to manage the Dock settings via policies. If yes, can you share the details on how to configure it?
Yes, Hexnode UEM provides a policy to configure Dock settings for macOS devices. By following the steps below, you can personalize settings such as icon size, magnification, and more.
- Login to your Hexnode UEM portal.
- Go to Policies > New Policy. Assign a suitable name and description (optional) for the policy.
- Select macOS > Configurations > Dock. Click Configure.
Please refer to our help doc on customizing the Mac Dock settings for detailed information.
Happy testing
John Cooper,
Hexnode UEM
-
Expand