auramagi / NewIcon

macOS icon customization
MIT License
13 stars 0 forks source link

NewIcon

NewIcon is a command line tool to modify and manage icons for applicatons, files, and directories on macOS.

Features

Installation

Install using Mint.

$ mint install auramagi/NewIcon

Usage

Overlay text over the original icon

$ new-icon text FILE TEXT

# Add version number to Xcode app icon
$ new-icon text /Applications/Xcode.app 13.4.1

Revert an icon to the original

$ new-icon reset FILE

Usage with SwiftUI template files

Use a SwiftUI template to modify an icon

$ 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

Create a sample template file

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

Open a template file in Xcode

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

Editing the sample template

Clear build cache for templates

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

Detailed command info

Run new-icon help to see all options.