Skip to content

Instantly share code, notes, and snippets.

@mculp
Created September 27, 2025 02:15
Show Gist options
  • Select an option

  • Save mculp/aa70837d01dc944f70057df0dce60bc1 to your computer and use it in GitHub Desktop.

Select an option

Save mculp/aa70837d01dc944f70057df0dce60bc1 to your computer and use it in GitHub Desktop.
Programmatically set the apps in your Dock
# every time I set up a MacBook, I have to remove like 50 apps from the dock.
# this script is now part of my laptop setup script.
# Run this first, just so you have your existing dock output if you need to revert
defaults read com.apple.dock persistent-apps
# Careful - this deletes all apps from your dock
defaults delete com.apple.dock persistent-apps
# Basically, the only thing that changes between each line is the file:/// location
defaults write com.apple.dock persistent-apps -array \
'<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>file:///Applications/Google%20Chrome.app/</string><key>_CFURLStringType</key><integer>15</integer></dict></dict></dict>' \
'<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>file:///System/Applications/Calendar.app/</string><key>_CFURLStringType</key><integer>15</integer></dict></dict></dict>' \
'<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>file:///System/Applications/App%20Store.app/</string><key>_CFURLStringType</key><integer>15</integer></dict></dict></dict>' \
'<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>file:///System/Applications/System%20Settings.app/</string><key>_CFURLStringType</key><integer>15</integer></dict></dict></dict>' \
'<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>file:///Applications/Discord.app/</string><key>_CFURLStringType</key><integer>15</integer></dict></dict></dict>' \
'<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>file:///Applications/Warp.app/</string><key>_CFURLStringType</key><integer>15</integer></dict></dict></dict>' \
'<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>file:///Applications/Raycast.app/</string><key>_CFURLStringType</key><integer>15</integer></dict></dict></dict>'
killall Dock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment