-
-
Notifications
You must be signed in to change notification settings - Fork 67
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 option to open unknown URLs #74
Conversation
Thanks for this PR, it looks well done. My issue is that an unknown URL could be anything, and so having just one command for it isn't really portable. It could be any number of schemes: |
It allows the user to at least specify another program that will handle unknown schemes, like I guess the better approach would be to have a dictionary of scheme-program in the configuration, although I don't know how to implement that in go yet. |
OK, I've got a better suggestion. The config file will look like this: [url_handlers]
http = "xdg-open"
gopher = "off"
ftp = "off"
# and any other URL schemes the user desires.
other = "xdg-open" Then in If this sounds good I think I can implement it in the next days. |
That sounds great! Good idea. I think we can leave the HTTP setting in |
Make sure to update |
Thanks for the tip, will do! |
Updated as discussed and tested with Gopher URLs. I didn't know of any pages with other kinds of URLs but it should work for all schemes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great feature, thanks! See my comments below, I will merge soon.
Looks good now, thanks. I will merge soon, after my current linting fixes, like with the other PR. Also I'd appreciate if you didn't force-push for any future PRs, as it makes it impossible to see the diffs as you update things. Thanks for your interest in Amfora! |
Sorry for the force pushes, won't do it again 😃 And thanks for making Amfora! |
A new config option that sets a command to open unsupported URL schemes (e.g.
gopher://
). It is unset by default to keep the previous behavior.