Skip to content

sergiolenza/customize-icons

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

customize-icons

customize your icons on El Capitan

index

intro

OS X El Capitan introduced a new security policy preventing users from changing any system icon. You can still continue to change your apps and volumes icons normally.

Apps like LiteIcon still work pretty well for this sort of thing, but it requires a lot of manual dragging.

If you're like me and enjoy using the terminal to automate work-flows, I think you'll enjoy what's to follow.

tools

step 1

Getting some cool icons.

DeviantArt is my go-to place for icons sets, but you can also try IconArchive for a broader range of options.

step 2

Step 2 - Get The Command

I include this command file in the ZIP file mentioned in Step 1, but for reference, here is the code for the ChangeIcons.command.

[code language="plain"]#!/usr/bin/env ruby

require 'json' require 'shellwords'

if ENV['USER'] != 'root' puts "You'll be prompted once to enter you administrator password." end

Dir.chdir(File.dirname(FILE)) do

file = File.read(%Q(.set_icons/icon_data.json)) icon_data = JSON.parse(file)

icon_data.each do |key, value|

app_path = "/Applications/#{key}"

if Dir.exists?(app_path) and File.exists?("#{value}.icns")
  puts "Changing icon for #{app_path}"
  `sudo .set_icons/setfileicon "#{value}.icns" "#{app_path}"`
end

end

puts "Restarting Finder and the Dock"

killall Dock

killall Finder

puts %Q(Finished!)

end [/code]

Now here comes the tricky part. This command relies on a JSON file that is named icon-data.json and a UNIX Executable File called setfileicon.

All The Icons Folder Screenshot - 1All The Icons Screenshot - 2

These files are both included in a folder called set_icon in the ZIP file provided in Step 1.

The icon-data.json file looks something like this:

[code language="plain"]{ "1Password 5.app":"1Password 5", "Alfred 2.app":"Alfred 2", "Amphetamine.app":"Amphetamine" } [/code]

It is formatted with the name of the app first in quotes followed by a semi-colon and then the name of the icns file.

Edit this icon-data.json file to include your own apps or create it yourself using your favorite text-editor.

Here is how the JSON file for the Utilities looks like.

JSON file

It is case-sensitive, so make sure to type everything correctly to suit what the app is called and what you named the corresponding icns file.

When you are editing this file to add on your own apps, make sure there’s not a comma on the last line or there will be an error.
Now, using Terminal, type in the following: defaults write com.apple.finder AppleShowAllFiles YES. Once you press Enter, this command will show all the hidden files on your Mac. Don’t mess with any of these hidden files. The reason Apple hides them is so that the user has less of a chance of messing things up.
To make the files hidden again later, type in the same command but with a NO at the end like this: defaults write com.apple.finder AppleShowAllFiles NO.
After that, type in killall Finder into Terminal for the command to restart the Finder and have the hidden files be revealed in your Finder.

Show Hidden Files Command in Terminal

Now that you have your Finder revealing all the hidden files - in the folder where you have all your icons properly named, copy and paste the folder set_icons from the ZIP file mentioned in Step 1, and rename it to .set_icons. Adding a period in front of the folder name makes it hidden and you will therefore not be able to see it anymore.

It looks exactly like the .set_icons folder already included within the folder called Utilities that can be found in the ZIP file.

Utility Sub-Folder

So if you want to change your Utility icons as well, the .set_icons folder located in the sub-folder Utilities already has the json file with all the necessary modifications.

The only difference between the ChangeIcons.command within the All The Icons folder and the ChangeUtilityIcons.command located within theUtilities folderis that on Line 36, the app path is listed asapp_path = “/Applications/Utilities/#{key}”`.
A special thanks to James Moore, who created the ChangeIcons.command to replace all the icons and Damien Bobillot who created the setfileicon UNIX Executable File.

Step 3 - Execute Command

otherwise known as TLDR
Now you probably have something like the following:
  • a folder called All The Icons with
    • all the icons you want to replace your old ones (in icns format)
    • the ChangeIcons.command that was included in this ZIP file
    • a hidden sub-folder called .set_icons with
      • a modified icon-data.json file to include your own personal apps
      • the setfileicon UNIX executable file
At this point, if you’ve done everything right, you can “hide” your hidden files again in your Finder by executing the command defaults write com.apple.finder AppleShowAllFiles NO in Terminal. Make sure to execute killall Finder as well so that your Finder restarts and shows the changes.

Now go ahead and click the ChangeIcons.command to change all your icons simultaneously.

ChangeIcons.command in Terminal

You will be prompted to enter your password and walla you have all your snazzy new icons in place in seconds!

If you want to change your Utility icons as well, go ahead and click ChangeUtilityIcons.command too within the sub-folder called Utilities, assuming you properly named all the icons so that it works with the json file that is shown in Step 2.

Possible Errors You May Encounter

  • You tried to edit the command files and now have a syntax error, like in the form of quotes - just make sure to use straight quotes.
  • You have a syntax error in your icon-data.json file, like a comma on the last line.
  • You forgot to include a certain app in your icon-data.json file and so the icon does not change when you execute the command.
  • An app is locked and, therefore, the icon cannot be changed. To unlock an app, go to the app, right click,  Get Info. Uncheck the Locked button.
Locked App Error In TerminalLocked App - Dropbox

Have fun with your new icons! 😍

Tips or tricks?
contact me @fvcproductions

contributing

This is the icon_data.json. This contains all the necessary information the Unix executable file setfileicon will need to change your Mac App icons.

You will never be able to see either of these files because they are hidden in a system folder called .set_icons.

To be able to view and edit these files, you will have to run the following 2 commands in Terminal to temporarily reveal all hidden folders/files:

$ defaults write com.apple.finder AppleShowAllFiles YES
$ killall Finder

To undo this, enter the following into Terminal:

$ defaults write com.apple.finder AppleShowAllFiles NO
$ killall Finder

On the left we have the name of the Mac App with the .app extension.

On the right we have the actual name of the icon we want to use for that Mac App except without the extension of the image which should always be a .icns extension

{
    "1Checker.app": "Calibre",
    "1Password 5.app": "1Password 5",
    "Alchemize.app": "Alchemize",
    "Alfred 2.app": "Alfred 2",
    "Alternote.app": "Alternote",
    "Amphetamine.app": "Amphetamine",
    "AppCleaner.app": "AppCleaner",
    "App Store.app": "App Store",
    "Automator.app": "Automator",
    //"Awareness.app":"Awareness",
    "Bartender.app": "Bartender",
    "BetterSnapTool.app": "BetterSnapTool",
    "Blocs.app": "Blocs",
    "Blogo.app": "Blogo",
    "Blotter.app": "Blotter",
    "Brackets.app": "Brackets",
    "Byword.app": "Byword",
    "Calculator.app": "Calculator",
    "Calendar.app": "Calendar",
    "Candlelight.app": "VOX",
    "Cathode.app": "iTerm",
    //"cDock.app":"cDock",
    "Characters.app": "Characters",
    "Chess.app": "Chess",
    "Chrome App Launcher.app": "Chrome App Launcher",
    "CleanMyMac 3.app": "CleanMyMac",
    "Coda 2.app": "Coda",
    "CodeKit.app": "CodeKit",
    "CodeRunner.app": "CodeRunner",
    "Contacts.app": "Contacts",
    "CrashPlan.app": "CrashPlan",
    "Dash.app": "Dash",
    "Dashboard.app": "Dashboard",
    "Day One.app": "Day One",
    "Deckset.app": "Deckset",
    "Dictionary.app": "Dictionary",
    "Dropbox.app": "DropBox",
    "DVD Player.app": "DVD Player",
    "Easy Image Converter.app": "Easy Image Converter",
    "Evernote.app": "Evernote",
    "FaceTime.app": "FaceTime",
    "Fantastical 2.app": "Fantastical",
    "Flux.app": "Flux",
    "Font Book.app": "FontBook",
    "Game Center.app": "Game Center",
    "GitBook.app": "GitBook",
    "Google Chrome.app": "Google Chrome",
    "Google Drive.app": "Google Drive",
    "Google Photos Backup.app": "GooglePhotosBackup",
    "Healthier.app": "Lep",
    "Image2icon.app": "BambooDock",
    "iBooks.app": "iBooks",
    "iBooks Author.app": "iBooksAuthor",
    "iConvert Icons.app": "iConvert Icons",
    "Image Capture.app": "Image Capture",
    "iMovie.app": "iMovie",
    "iStudiez Pro.app": "iStudiez",
    "iTerm.app": "iTerm",
    // "iTunes.app":"iTunes",
    "iTunes Producer.app": "Celtx",
    "Keynote.app": "Keynote",
    "LaunchPad.app": "LaunchPad",
    "LiteIcon.app": "LiteIcon",
    "MacUpdate Desktop.app": "MacUpdate",
    "Mail.app": "Mail",
    "Maps.app": "Maps",
    "Marked.app": "Marked 2",
    "Marked 2.app": "Marked 2",
    "MenuTab for Trello.app": "Anki2",
    "Messages.app": "Messages",
    "Mint QuickView.app": "Mint",
    "Mission Control.app": "MissionControl",
    "Mobirise.app": "iOS Simulator",
    "Mou.app": "Mou",
    "MySQLWorkbench.app": "MySQLWorkbench",
    "Notes.app": "Notes",
    "Numbers.app": "Numbers",
    "Pages.app": "Pages",
    "Photo Booth.app": "Photo Booth",
    "Preview.app": "Preview",
    "PopcornTime.app": "PopcornTime",
    "puush.app": "Puush",
    "QuickTime Player.app": "QuickTime",
    "Raindrop.app": "Raindrop",
    "Reminders.app": "Reminders",
    "RescueTime.app": "Origin",
    "Safari.app": "Safari",
    "ScreenFlow.app": "ScreenFlow",
    "Screenhero.app": "Screenhero",
    "Shazam.app": "Shazam",
    "Sip.app": "Sip",
    "Sketch.app": "Sketch",
    "Skype.app": "Skype",
    "Slack.app": "Slack",
    "Sorty.app": "Sorty",
    "SoundCloud Downloader.app": "SoundCloud",
    "Stickies.app": "Stickies",
    "Sublime Text.app": "Sublime Text",
    "System Preferences.app": "System Preferences",
    "TextEdit.app": "TextEdit",
    "The Unarchiver.app": "The Unarchiver",
    "Time Machine.app": "Time Machine",
    "Tower.app": "Tower",
    "Ulysses.app": "Ulysses",
    "uTorrent.app": "uTorrent",
    "VLC.app": "VLC",
    "Xcode.app": "Xcode",
    "Xpressive.app": "Xpressive",
    "Yoink.app": "Yoink",
    "YNAB 4.app": "YNAB"
}

So if we wanted to add an icon for the Ember Mac App, then we would just add the following line right after the line that has EasyImageConverter (so that it stays in alphabetical order):

    "Ember.app": "Ember",

There would have to be a file called Ember.icns in the directory and the user would need the Ember.app installed on their Mac's Applications directory for this icon change to actually work.

If Ember wasn't installed, then the script would just skip that line.

To submit a successful pull request, you have to do the following:

credits

About

Customize your icons on El Capitan.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%