makew0rld / amfora

A fancy terminal browser for the Gemini protocol.
GNU General Public License v3.0
1.16k stars 67 forks source link

Ability to run user-defined actions/scripts #262

Open mntn-xyz opened 3 years ago

mntn-xyz commented 3 years ago

It would be nice to have a hotkey or bar command to run a user-defined action with the argument being the current URL or the URL of a specific link #. For instance, I might want to append the URL to a text file, use Emacs org-capture to file the URL appropriately, compose a new email with the link in the message body, etc.

makew0rld commented 3 years ago

Yeah that could be useful. But you can already copy the current URL to the clipboard with a command, so I'm not sure if this would really be worth it.

mntn-xyz commented 3 years ago

True, I wouldn't consider it high priority, but it would save a couple of keystrokes each time, which can add up.

What led me to suggest this is that I like to manage bookmarks in orgmode, as I can annotate, categorize, and tag them appropriately. The bookmarks functionality in Amfora works well enough, but it isn't adequate for my needs. (Not a criticism of Amfora, by the way; Chrome's bookmarks functionality also isn't adequate from my perspective. I have too many bookmarks.)

makew0rld commented 3 years ago

Fair enough. I'll leave this issue open but I can't say I plan on working on it any time soon.

mntn-xyz commented 3 years ago

I came up with another use case. You could set up a hotkey to run a script that would generate a certificate for the current site and update the config file. Unfortunately you'd currently need to reload Amfora to get the updated config, but this could make certificate generation much quicker.

And a variation on what I mentioned before: you could run a script to append URLs to a file using a single keypress, for the purpose of quickly building a curated collection of URLs. When ready, you could then send this file through a script to generate an epub or pdf. (Or you could set up a second action that automatically builds the epub/pdf, emails it to your e-reader, and clears out the current curated list of files.) Lots of potential!

I may look at putting together a PR for this in the near future.

makew0rld commented 3 years ago

Definitely some interesting uses there. A PR would be appreciated if the changes aren't too extensive and are documented. Thanks!

mntn-xyz commented 3 years ago

Things I didn't add in the PR, but which I considered: