NewIcon is a command line tool to modify and manage icons for applicatons, files, and directories on macOS.
- A quick way to overlay some text over an icon
- Reset to the original icon
- Use any SwiftUI View as a template
Install using Mint.
$ mint install auramagi/NewIcon
$ new-icon text FILE TEXT
# Add version number to Xcode app icon
$ new-icon text /Applications/Xcode.app 13.4.1
- Tip: when changing Xcode icon, don't forget about the Simulator icon! It's located inside the Xcode bundle:
/Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
$ new-icon reset FILE
$ new-icon template icon TEMPLATE FILE CONTENT
See SampleTemplates folder for some inspiration.
File | Command | Output |
---|---|---|
NewHue.swift | new-icon template icon NewHue.swift /Applications/Xcode.app red |
|
Trash.swift | new-icon template icon Trash.swift /Applications/Xcode.app |
If you need a place to start with writing your own SwiftUI template files, run this command to get a sample template.
$ new-icon template init
NewIcon allows you to edit a template file with Xcode by creating and opening a temporary SwiftPM package. Edit Template/Sources/Template/Template.swift
inside, and any changes will be synced to the original file. After you are done editing close Xcode and press return to delete this temporary package.
$ new-icon template edit TEMPLATE
- Tip: Make sure
My Mac
is selected as build destination.
Template files need to be built before they can be used. At the very least, this takes several seconds, so NewIcon caches build products inside ~/.new-icon/cache
to speed up any subsequent use of the same template. There is a simple command to clear this cache.
$ new-icon template cache clear
Run new-icon help
to see all options.