Automatically modifying app icons?

Currently I’m using the “tip version” of Ghostty, because I need search functionality, which is not available yet in the stable version. This means that there’s an app update almost every day…

Instead of a blue screen I want a black screen in Ghostty’s app icon. Therefore, I open the /Applications folder in Finder, right click Ghostty.app, choose “Get Info” and drag a PNG image (with a black background) to the pane.

This works, but doing it every day is “busy work”, so I would like to automate this.

How can I achieve that?

(Hazel available)

I use Pictogram and it works pretty well. Some limitations but might work for what you’re wanting.

1 Like

Thank you for the suggestion!

Unfortunately it can’t update the Ghostty icon at all it seems… :cry:

1 Like

Pictogram completely broke the icon for Ghostty:

Ghostty@2x

How can I fix (reset) this?

(Uninstall and re-install of Ghostty did not help)

In Get Info, check the permissions at the bottom, add yourself if not present

Restarted the system? It’s usually tied to the system’s cache, or something stored in memory in Finder/Dock.

You can try to reset icon cache. If you’re uncomfortable in the Terminal, you should be able to use a tool like CleanMyMac, or Onyx.

Also is Pictogram still running? If so, it might still trying to modify Ghostty’s icon and since it can’t it’s causing it to still look like a folder. Just a theory.

I had already fixed the icon, I thought, but it returned to a Folder icon after a system restart…

Pictogram is already uninstalled (before that restart).

I’ll check again after the next restart.

I’m also interested in this. My use case is a little different (and the Pictogram app didn’t work because it only only looks for apps in ~/Applicaitons). I want to change the app icons for applications associated with my Parallels Desktop virtual machine. The app icons are located at:
~/Applications (Parallels)/Windows 11 Applications/ ← These are helper apps created by Parallels Desktop that connect to Windows 11 applications running in my virtual machine.
~/Library/Application Support/Parallels Desktop/{UUID of VM}/ ← This is where the main helper app for the VM is located (e.g., clicking it opens the Windows 11 Start Menu when operating in Coherence mode).

I can manually change the icons using Get Info and pasting the icons, but they tend to get lost when I reboot the Mac.

If the above solutions didn’t work, if you have Keyboard Marstro try making a workflow that runs on device start
Get info,
click at X, Y,
paste image

I was too curious and rebooted just to see what happens…

Seems fine :sweat_smile:

Ghostty@2x

Question remains what happens when the Ghostty app updates, but I switched to the stable channel after this week’s 1.3.0 release (which has search - the reason I was using “tip”), so that might not happen for quite some time.

1 Like

Nope. Still broken :cry: I regret running Pictogram so much by now…

Tried this:

Still broken :sob:

Sorry. :frowning: I haven’t ever had any issues with the app, or I wouldn’t have recommended it. I’m a little leery to offer any more suggestions, worrying that it might make your situation worse.

That said… Claude says that the app’s icon is written in metadata that’s stored outside the app’s actual bundled file (in /Applications). I never knew that (if true).

Things to try:

  1. Manually remove icon
    CMD+I, or right-click > “Get Info”, on Ghostty. Select the icon in the top left corner, and press the “delete” key.

  2. Remove metadata attributes
    Open Terminal and run (verify that’s the actual path to the Ghostty app bundle):

xattr -d com.apple.ResourceFork /Applications/Ghostty.app
xattr -d com.apple.FinderInfo /Applications/Ghostty.app

I tried to verify that those terminal commands wouldn’t do anything harmful. Best of my ability it seems like it shouldn’t affect anything outside of the Ghostty app itself.

No need to apologize!

I have used Pictogram in the past myself, but forgot about it, so I was happy that you mentioned it.

I’m not a fan of AI, but those attributes are something I haven’t thought of myself, so I will investigate that. Thanks!

(I already tried the first suggestion before seeing your post; that did not fix it)

Found an interesting article on Medium on how to set custom icons using xattr.

However, this custom icon is already set when dragging an icon to the “Get Info” panel of the application.

Somehow this works fine for other apps, but not for Ghostty. Something on my Mac is removing its custom icon in com.apple.ResourceFork at every reboot…

Maybe the app uses a framework like React, not Swift?

No:

The macOS app is a native Swift app developed in Xcode

Source: Ghostty repository on GitHub

I can’t test right now, but I believe ghostty lets you customize icons through the app’s own settings. It might be its own icon management feature overwriting you.

1 Like

That’s indeed my current hypothesis…

I think it’s time to post a question on their GitHub repository, to see whether we’re right.

2 Likes

Posted here:

Let’s (wait and) see!