I have a folder called “App Icons” in my Dropbox. Just inside I have a shell script called install.sh
, and next to that I have folders for each app I want custom icons for. Currently that’s Atom and Mattermost.
Inside each directory I have atom.icns
and Mattermost.icns
, respectively.
To get both apps updated I run this script:
#!/usr/bin/env bash
set -euf -o pipefail
umask 077
has_copied=0
for atom in Atom "Atom Beta"; do
path="/Applications/${atom}.app"
[ -d "${path}" ] && \
cp ./Atom/atom.icns "${path}/Contents/Resources/atom.icns" && \
touch "${path}" && \
has_copied=1
done
for mattermost in Mattermost; do
path="/Applications/${mattermost}.app"
[ -d "${path}" ] && \
cp ./Mattermost/Mattermost.icns "${path}/Contents/Resources/Mattermost.icns" && \
touch "${path}" && \
has_copied=2
done
[ ${has_copied} = "2" ] && killall Dock
Atom usually updates immediately with the [ ${has_copied} = "2" ] && killall Dock
line. Mattermost does not, but I’m guessing that’s a case-by-case basis. I suspect there is a much smarter way to loop through all available icons and update their respective apps, but I’m no bash maestro, so I kept it simple.
In order to run this automatically you might use Automator, or event better, follow the instructions in this SO answer: https://stackoverflow.com/a/13372744/347884
If you choose the second route, make sure your shell script is executable:
chmod a+x /path/to/script.sh
Have fun!