kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

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

Open fabiospampinato opened 1 year ago

fabiospampinato commented 1 year ago

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:

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 commented 1 year ago

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