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

Add several macOS (non-) default application locs #52

Merged
merged 3 commits into from
Nov 14, 2018

Conversation

JayBrown
Copy link
Collaborator

@JayBrown JayBrown commented Nov 4, 2018

Hope this isn't too much. Please see the in-code notes especially about /System/Library/CoreServices. There are lot of non-application bundles in there.

~/Applications
~/Developer/Applications
/Network/Applications
/Network/Developer/Applications
---
/System/Library/CoreServices # incl. ./Applications
/Applications/Xcode.app/Contents/Developer/Applications
~/Library/Developer/Xcode/DerivedData
/Users/Shared/Applications

Note: I'm not sure if passing the absolute POSIX path like that is OK in Swift; cf. e.g. /Developer/Applications. EDIT: fixed with third commit, but some trailing slashes are missing from paths output.

```
~/Applications
~/Developer/Applications
/Network/Applications
/Network/Developer/Applications
---
/System/Library/CoreServices # incl. ./Applications
/Applications/Xcode.app/Contents/Developer/Applications
~/Library/Developer/Xcode/DerivedData
/Users/Shared/Applications
```
Should work now. Tested successfully with swift script using `/usr/bin/swift` shebang.
@zenangst
Copy link
Owner

@JayBrown I think it looks solid. However, we need to make some additional changes after this gets merged. Mainly need to handle apps that are agents. I would also exclude apps that lack an icon (that would get rid of some of the applications that shouldn't show up in the list.

But that is beyond scope of this PR. Great job @JayBrown 🥂

@zenangst zenangst merged commit 8a93de8 into zenangst:master Nov 14, 2018
@JayBrown
Copy link
Collaborator Author

Yes, definitely. I think that /System/Library/CoreServices/Applications should be safe, though, because Apple wouldn't call it "Applications", if there was anything other than real application-bundles in there.

As for the parent dir CoreServices, yes, a lot of stuff in there must be excluded: exlude everything that doesn't end on .app; exclude no-icon apps, but we'd have to keep in mind that there are also some regular applications in the default locations that don't have icons, so that rule should imho only apply to CoreServices; exclude agent applications would probably mean those with LSUIElement set to BOOL 1, right? But some of them might still be full-fledged apps, so maybe you can approach this on a case-by-case basis. But generally, I assume, Gray could work with several of the .app bundles in there, not just with Finder.

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

Successfully merging this pull request may close these issues.

2 participants