Live data from Hacker News

Show HN: Infat – Declaritive application assocation manager for macOS

github.com

21–30 of 43 posts

Re: Show HN: Infat – Declaritive application assocation manager for macOS

#21
This is a bit tangent, but does anyone know how to block an app from ever deciding to become a file handler on macOS?

Every time I install Chrome on my machine (for testing purposes), macOS decides that Chrome is going to be the default file handler for a bunch of file associations, including HTML, WebP, and so on… and I have to figure out which was which for all of the mappings (which is super frustrating).

I can read Info.plist from the bundle of the specific app (in this case, Google Chrome) that declares all of the UTIs, and then figure out which file associations that Chrome has messed up, but I don’t know how to get the default file associations (if it was not Chrome) before it.

Re: Show HN: Infat – Declaritive application assocation manager for macOS

#22

This is a bit tangent, but does anyone know how to block an app from ever deciding to become a file handler on macOS? Every time I install Chrome on my machine (for testing purposes), macOS decides that Chrome is going to be the default file handler for a bunch of file associations, including HTML, WebP, and so on… and I have to figure out which was which for all of the mappings (which is super frustrating). I can re…

MacOS doesn't give any way to block an association from happening, I'm assuming they're using the same API's under the hood that Duti is using, and the only way you could block that from being accessed is by disabling the Launch services API.

In the next release of Infat, I'm introducing listing the openers from the plist (As you're doing now). If you record these values, then get their set defaults through infat, you could put those into your config and load from you config whenever they're overriden!

Best I got... Shameless promotion

Re: Show HN: Infat – Declaritive application assocation manager for macOS

#23

This is a bit tangent, but does anyone know how to block an app from ever deciding to become a file handler on macOS? Every time I install Chrome on my machine (for testing purposes), macOS decides that Chrome is going to be the default file handler for a bunch of file associations, including HTML, WebP, and so on… and I have to figure out which was which for all of the mappings (which is super frustrating). I can re…

> This is a bit tangent, but does anyone know how to block an app from ever deciding to become a file handler on macOS?

The information below does not "block an app" from taking over file handler associations. It may be beneficial on its own and/or provide a starting point for further exploration.

> Every time I install Chrome on my machine (for testing purposes), macOS decides that Chrome is going to be the default file handler for a bunch of file associations, including HTML, WebP, and so on… and I have to figure out which was which for all of the mappings (which is super frustrating).

The following command can display current file extension associations for a user account:

  plutil -convert xml1 \
    ~/Library/Preferences/com.apple.LaunchServices.plist \
    -o -
In the XML output of the above should be the associations. As for determining changes, if Time Machine has been enabled, then changes to this plist can be identified.

Also regarding a Chrome OS-X/macOS installation - it installs plists for unconditional background updates. This may not be a desirable feature.

Re: Show HN: Infat – Declaritive application assocation manager for macOS

#25

Would you consider adding support for domain-specific overrides (e.g., open *.notion.site links with Chrome but other URLs with Safari) in future versions?

I use Hammerspoon for this and it's super configurable via Lua--open some URLs with Chrome profile 1, some with profile 2, some in incognito, open normal Spotify links with the Spotify app, normal Zoom links with Zoom (skip opening a tab that then opens the zoom:// link), etc.

For Google Drive links I open a picker that lets me choose from two chrome profiles and incognito.

Re: Show HN: Infat – Declaritive application assocation manager for macOS

#27

Would you consider adding support for domain-specific overrides (e.g., open *.notion.site links with Chrome but other URLs with Safari) in future versions?

I use Hammerspoon for this and it's super configurable via Lua--open some URLs with Chrome profile 1, some with profile 2, some in incognito, open normal Spotify links with the Spotify app, normal Zoom links with Zoom (skip opening a tab that then opens the zoom:// link), etc. For Google Drive links I open a picker that lets me choose from two chrome profiles and incognito.

cool

Re: Show HN: Infat – Declaritive application assocation manager for macOS

#28
I love that it’s a command line tool — I’ll try it soon.

I use OpenIn for this [1] (it’s paid, but a one-time purchase at a very reasonable price). It works with URLs too, supports “browser profiles”, and lets you create logic using JavaScript (e.g., do X if the filename contains Y, or do Z if a modifier key is pressed).

It works really well and even has the ability to “fix” what external apps have changed. I plan to use this on new Macs to reconstruct my app associations and rules.

I do wish the rules were defined in plain text files — sometimes it’s hard to follow the logic through the UI and the way it handles things.

Another comment mentions Hammerspoon (which I used in the past — it was very nice). Maybe I can rebuild part of my current setup with it.

[1] https://loshadki.app/openin4/

Re: Show HN: Infat – Declaritive application assocation manager for macOS

#29

Would you consider adding support for domain-specific overrides (e.g., open *.notion.site links with Chrome but other URLs with Safari) in future versions?

I use Hammerspoon for this and it's super configurable via Lua--open some URLs with Chrome profile 1, some with profile 2, some in incognito, open normal Spotify links with the Spotify app, normal Zoom links with Zoom (skip opening a tab that then opens the zoom:// link), etc. For Google Drive links I open a picker that lets me choose from two chrome profiles and incognito.

Would you mind sharing some tips on how to set that up? A code snippet or a link to the relevant docs would be super helpful.

Re: Show HN: Infat – Declaritive application assocation manager for macOS

#30
post #29

Earlier quoted context omitted.

I use Hammerspoon for this and it's super configurable via Lua--open some URLs with Chrome profile 1, some with profile 2, some in incognito, open normal Spotify links with the Spotify app, normal Zoom links with Zoom (skip opening a tab that then opens the zoom:// link), etc. For Google Drive links I open a picker that lets me choose from two chrome profiles and incognito.

Would you mind sharing some tips on how to set that up? A code snippet or a link to the relevant docs would be super helpful.

Certainly, the bulk of the functionality is provided by URLDispatcher:

https://www.hammerspoon.org/Spoons/URLDispatcher.html

Here's a cleaned up version of my config... I also mapped global cmd-shift-1/2/i to focus my profile and incognito windows (and create a window if none already existed):

https://gist.github.com/beaugunderson/d1ca2218b9b272f3ac3573...

Post reply on HN