Mac Os Change Icon For Applications

Mac OS X is notorious for being beautiful. Every vertical and horizontal line is just perfect... until you have that one application's icon which sticks out like a sore thumb. Obviously everyone has different aesthetic preferences, and this is not meant to hurt anyone's feelings.

Change apple mac icon

It has always been possible to replace these icons by hand. The steps generally go like this:

  1. Find an icon you actually want (@2x too for retina)
  2. Download it, but it is probably a PNG
  3. Convert it to an .icns file
  4. Find the Application that you want to replace the icon on in Finder
  5. Open the inspector (⌘ + I)
  6. Quite literally drag (or copy-paste) the .icns onto the application icon

Have you ever had a problem with incorrect icons in OS X—instead of seeing the proper “zipper” icon for zip files, for example, you see a FireWire drive icon or a disk image icon. Sometimes, apps icon change but we like the older icon. Thankfully, it’s very easy to change the app icon in Mac. In Mac OS, all the applications have.app extension but it ships in the form of a zip file. So you can easily check the contents of any application, find out the icon file, and replace it.

If you think I am joking, check Apple's own help page for changing Application icons. The downside to this approach (aside from being completely manual) is that application updates often overwrite your beautiful custom icons! Then you end up clicking around Finder to make everything pretty again. To an automation-obsessed person like myself, this is unacceptable.

Replacing the Icons

How To Change Mac Icon

In case you may be unaware, 'applications' in OS X are actually folders. Apple calls them 'packages', but seriously, they are just folders. You can cd into them:

If we take a dive into that folder, inside the Info.plist there will be an entry for CFBundleIconFile and CFBundleTypeIconFile

  • CFBundleIconFile - the icon that will show up in Finder and the Dock
  • CFBundleTypeIconFile - the icon for others files to be opened by this app (not all applications will have this file)

In Atom, the CFBundleIconFile is atom.icns, but it could be named any other file. The name refers to the name of the file in the Contents/Resources folder. Sure enough, it is there:

Change

Great! Now we can just replace the icon using some basic unix commands. Grab the icon you want and put it somewhere safe. I personally use ~/.custom-icons, but you could use any path - just be sure to update the script below.

Mac os change icon for applications download

I get a lot of my icons off Dribbble (thanks great designers!), and I personally use this one for my Atom icon:

Free Mac Os Icons

This will replace the icon, but you have to restart your computer for the changes to take effect... or do you?

Forcing a Reload

By default, application icons are loaded into the cache at boot time. There are a few techniques for forcing a reload of that icon cache on the Internet, but there is actually a much easier approach - simply touch the app:

I actually have no clue why this works, but the computer scientist in me says that something about changing the lstime of the file causes the cache to be invalidated. Now you just need to restart Finder and the Dock to pick up the changes:

Now we can easily script the whole thing! Here is my complete script:

One thing to note: if the application corresponding to the icon you are replacing is currently running, you will need to quit that application before running the script. My script used to Force-Quit the application, but that turned out to be a bad idea for an editor.

Mac Os Setting Icon

Mac

Conclusion

Hopefully this post helps you automate icon replacements, and, again, this is in no way intended to make the Atom developers feel bad (or any of the other 15 application icons I replace). When new app updates happen, just rerun the script and your icons will be great again!