qutebrowser: Add doi2scihub script

Added script which takes you to the corresponding sci-hub entry for any
DOI. DOIs can be passed in three ways:

- via hinted link (shortcut `;p` to start hinting)
- via selected text (select text then invoke `send-to-scihub` command
  with `"p`)
- or from meta tags in current page (invoke `send-to-scihub` command
  with `"p` when on article page)

It will grab the newest sci-hub link and attempt to bring you the
corresponding pdf file.
This commit is contained in:
Marty Oehme 2022-12-09 12:51:10 +01:00
parent b2ee02e474
commit 7e2da571e7
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9
4 changed files with 110 additions and 1 deletions

View file

@ -16,6 +16,8 @@ c.aliases["send-to-archive"] = "open https://web.archive.org/web/{url}"
# save current page to pdf file
c.aliases["save_to_pdf"] = "spawn --userscript pagetopdf.sh"
# open sci-hub pdf for doi
c.aliases["send-to-scihub"] = "spawn --userscript doi2scihub"
# translate current page / selection with google translate
c.aliases["translate-page-google"] = "spawn --userscript translate_google.sh"

View file

@ -77,6 +77,8 @@ config.bind('"T', "translate-selection-google", mode="normal")
config.bind('"q', "show-qr")
config.bind(lleader + "r", "spawn --userscript readability")
config.bind('"p', "send-to-scihub", mode="normal") # view current page doi on scihub
config.bind(";p", "hint links run send-to-scihub") # view linked doi on scihub
# set stylesheets for the browser to use
config.bind(

View file

@ -1,7 +1,7 @@
from qutebrowser.api import interceptor
c.url.searchengines = {
"#sci": "https://sci-hub.do/{}",
"sci": "https://sci-hub.ru/{}",
"DEFAULT": "https://search.martyoeh.me/?q={}",
"al": "https://wiki.archlinux.org/index.php/{}",
"alt": "https://alternativeto.net/software/{}/?license=opensource",