Skip to content

Instantly share code, notes, and snippets.

@nuada
Last active February 27, 2017 14:04
Show Gist options
  • Save nuada/4d3ba043050b473b4088a09185ccb481 to your computer and use it in GitHub Desktop.
Save nuada/4d3ba043050b473b4088a09185ccb481 to your computer and use it in GitHub Desktop.
Add application icon or folder to macOS Dock
#!/bin/bash
# usage: add_to_dock.sh <path to your .app bundle or directory>
defaults write com.apple.dock persistent-apps -array-add "<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>${1}</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>"
killall Dock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment