Live data from Hacker News

Show HN: Infat – Declaritive application assocation manager for macOS

github.com

31–40 of 43 posts

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

#31
post #29

Earlier quoted context omitted.

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

Thanks a lot — that’s way more than I expected!

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

#32

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?

Thank you for the question! I didn’t even think of this use case. I’ll setup regex (and wildcards) but not scripting.

Check back in a week!

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

#33
post #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…

I loveee hammerspoon. And had a subscription to OpenIn a bit back. Advanced scripting isn’t going to happen, even paging out to another script. Recently committed to Regex which would cover most of that. I’ll look into how it “fixes” old associations.

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

#35
post #4

Pretty slick honestly, swapping machines on Mac is usually a pain for me so this feels like a lifesaver.

See also Jeff Geerling's Ansible for configuring Macs. https://www.jeffgeerling.com/project/mac-development-ansible...

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

#36
I see that you mentioned it is inspired by duti. I think may be adding a comparison on how it solves what it couldn’t would be beneficial.

From quick skim and memory it seems a notable one is url scheme association.

One problem I had with duti is to associate extensions automatically from a pre defined “table”. Automating that involves shell scripting[^1]. Also associating extension to softwares that hasn’t been installed. Another pain point is there’s two ways to associate and depending on different cases one is better than another.

[1]: https://github.com/ickc/bootstrapping-os-environments/blob/m...

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

#37
post #3

Great to see this, thanks for sharing! Do you have plans to make it available in nixpkgs and potentially as a home-manager or nix-darwin module? Then I could add it to my config and have everything set up automatically.

The first question that came to mind for me is “is this already achievable with Nix-Darwin”? If not, it fits very well into the nix ecosystem

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

#38

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?

Thank you for the question! I didn’t even think of this use case. I’ll setup regex (and wildcards) but not scripting. Check back in a week!

Walking this back, the API only allows setting this up for app bundles, which adds another layer of complexity I'm not down for. I want it to be a CLI tool, it doesn't need a helper or any other layers.

As a kind of apology, I made a drop-in hammerspoon config that should accomplish exactly what you wanted: https://gist.github.com/philocalyst/ad9f6d7cc08a9cdefa795e1b...

And if you've never used it before: https://www.hammerspoon.org/go/

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

#39
post #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…

I loveee hammerspoon. And had a subscription to OpenIn a bit back. Advanced scripting isn’t going to happen, even paging out to another script. Recently committed to Regex which would cover most of that. I’ll look into how it “fixes” old associations.

Walking back my regex commitment, just a heads-up/apology if you had your hopes up. Want this to stay as a CLI and not a dynamic app. Let me know if there's anything else you could see useful that would fit within that scope!
Post reply on HN