qutebrowser: Refactor gemini userscript

Now possibly a little less clunky (though still using soon-to-be
deprecated modules), and able to correctly surf gemini/non-gemini pages
as a userscript or as a stand-alone script (simply calling it from
command line).

Works as before for tabbed pages (the clunky rename/symlink way).

Can now also be used as the default way to surf to links so I switched
out my qutebrowser f/F link hinting for this script. Will simply open
links if staying on http but open gemini version as local file if moving
on to gemini.

Could probably be rewritten as an actual plugin to interject itself in
link opening to be a little more elegant (similar to the redirect code I
have running to move to open source web frontends).
This commit is contained in:
Marty Oehme 2023-08-08 15:52:12 +02:00
parent f09a75820e
commit f7304b8941
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
3 changed files with 78 additions and 33 deletions

View file

@ -1,4 +1,4 @@
c.aliases["gem"] = "hint links userscript qute-gemini"
c.aliases["gem"] = "spawn --userscript qute-gemini "
# Use q for quitting a tab (mimicks vim buffer) - qa is used for exiting
c.aliases["q"] = "tab-close"

View file

@ -6,6 +6,10 @@ lleader = ","
## CHANGED DEFAULTS
# the full power of qutebrowser at your fingertips for any gemini page!
config.bind("f", "hint links userscript qute-gemini")
config.bind("F", "hint links userscript qute-gemini-tab")
# rebind moving tabs to free for download
config.bind("gG", "tab-give")
# switch binds for scroll-marks and quick-/book-marks