forked from OriR/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_c-configure-dock-osx.sh.tmpl
38 lines (34 loc) · 2.71 KB
/
run_c-configure-dock-osx.sh.tmpl
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
29
30
31
32
33
34
35
36
37
38
{{ if eq .chezmoi.os "darwin" -}}
#!/bin/sh
# Write a temporary file containing the template needed for adding an item to the dock, having "APP_PATH" & "APP_NAME" as placeholders.
# The basic template was taken from here: http://hints.macworld.com/article.php?story=20040819170450489
cat > /tmp/dock-config-template <<- EOF
<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>APP_PATH</string><key>_CFURLStringType</key><integer>0</integer></dict><key>file-label</key><string>APP_NAME</string></dict><key>tile-type</key><string>file-tile</string></dict>
EOF
# Add the following applications to the dock:
# * ITerm
# * Slack
# * WhatsApp
# * Launchpad
# * WebStorm
# * System Preferences
# * Visual Studio Code
# * Google Chrome
# * Evernote
# * Figma
# * Sourcetree
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/ITerm.app/g" -e "s/APP_NAME/ITerm/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/Slack.app/g" -e "s/APP_NAME/Slack/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/WhatsApp.app/g" -e "s/APP_NAME/WhatsApp/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/Launchpad.app/g" -e "s/APP_NAME/Launchpad/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/WebStorm.app/g" -e "s/APP_NAME/WebStorm/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/System\ Preferences.app/g" -e "s/APP_NAME/System Preferences/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/Visual\ Studio\ Code.app/g" -e "s/APP_NAME/Visual Studio Code/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/Google\ Chrome.app/g" -e "s/APP_NAME/Google Chrome/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/Evernote.app/g" -e "s/APP_NAME/Evernote/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/Figma.app/g" -e "s/APP_NAME/Figma/" /tmp/dock-config-template)"
defaults write com.apple.dock persistent-apps -array-add "$(sed -e "s/APP_PATH/\/Applications\/Sourcetree.app/g" -e "s/APP_NAME/Sourcetree/" /tmp/dock-config-template)"
# Remove the temporary template file.
rm -rf /tmp/dock-config-template
killall Dock
{{ end -}}