Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fabiospampinato opened this issue Aug 29, 2023 · 1 comment
Open

Comments

@fabiospampinato
Copy link

fabiospampinato commented Aug 29, 2023

  • 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.

@kasper
Copy link
Owner

kasper commented Sep 2, 2023

Good idea, I will see what can be done on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants