Skip to content

Support retrieving the icon for any app, even if it's not opened #339

@fabiospampinato

Description

@fabiospampinato
  • Version: 4.0.0
  • macOS: Monterey (12.5.1)

It looks like App.get(appName).icon() only works if the app is already opened.

I'm trying to build a custom minimal spotlight-like thing for opening apps on top of input modals, and I'd like to be able to show the icon of the app that will be opened with the current search query, but problem is getting this icon seems pretty complicated, because:

  • Phoenix's native API only works for opened apps.
  • Anything I can find online tells me to do like defaults read 'Contents/Info.plist' CFBundleIconFile, which will tell me the name of the .icns file in the Resources folder, but that doesn't seem to actually work for every single app, some of them, like /System/Applications/Calendar.app, has an Assets.car thing which presumably contains the icon. And this car format seems not publicly documented.

Presumably on Phoenix's end there are APIs available to figure this out and solve the problem for user's configurations.

If so, I'd propose supporting something like this: App.get('/System/Applications/Calendar.app').icon(), to retrieve the icon for any app, which would be pretty handy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions