diff --git a/qutebrowser/config/alias.py b/qutebrowser/config/alias.py index f3e4279..671718b 100644 --- a/qutebrowser/config/alias.py +++ b/qutebrowser/config/alias.py @@ -8,8 +8,9 @@ c.aliases["e"] = "session-load" # wallabag add current page, either with walla command, or bw c.aliases["add-wallabag"] = "spawn --userscript wallabag_add.sh" -# add to (my) shaarli instance +# add to bookmarks to my instances c.aliases["add-shaarli"] = "spawn --userscript shaarli_add.sh" +c.aliases["add-linkding"] = "spawn --userscript linkding_add.sh" # re-opens the current page on the web archive overview page c.aliases["send-to-archive"] = "open https://web.archive.org/web/{url}" diff --git a/qutebrowser/config/maps.py b/qutebrowser/config/maps.py index fb4f192..648181b 100644 --- a/qutebrowser/config/maps.py +++ b/qutebrowser/config/maps.py @@ -72,8 +72,8 @@ config.bind("gD", "recent-downloads", mode="normal") config.bind('"w', "add-wallabag", mode="normal") # add current page to wallabag config.bind(";w", "hint links userscript wallabag_add.sh") # add link to wallabag -config.bind('"s', "add-shaarli", mode="normal") -config.bind(";s", "hint links userscript shaarli_add.sh") +config.bind('"s', "add-linkding", mode="normal") +config.bind(";s", "hint links userscript linkding_add.sh") config.bind('"a', "send-to-archive", mode="normal") diff --git a/qutebrowser/config/searchengines.py b/qutebrowser/config/searchengines.py index e1f9824..d7b77c4 100644 --- a/qutebrowser/config/searchengines.py +++ b/qutebrowser/config/searchengines.py @@ -15,7 +15,7 @@ c.url.searchengines = { "hn": "https://hn.algolia.com/?q={}", "hub": "https://hub.docker.com/search?q={}", "kb": "https://soeg.kb.dk/discovery/search?query=any,contains,{}&lang=en", - "l": "https://links.martyoeh.me/?searchterm={}&searchtags=", + "l": "https://links.martyoeh.me/bookmarks?q={}", "lib": "http://libgen.fun/search.php?req={}", "man": "https://manned.org/browse/search?q={}", "maps": "https://facilmap.org/#q={}", diff --git a/qutebrowser/data/userscripts/linkding_add.sh b/qutebrowser/data/userscripts/linkding_add.sh new file mode 100755 index 0000000..40768fa --- /dev/null +++ b/qutebrowser/data/userscripts/linkding_add.sh @@ -0,0 +1,27 @@ +#! /usr/bin/env bash +# +# Send current page/link to a shaarli instance. +# +# Can be used for sending the current page via: +# :spawn --userscript shaarli_add.sh +# for sending an arbitrary page passed as argument: +# :spawn --userscript shaarli_add.sh https://myinterestingpage.com +# or for sending a hinted link: +# :hint links userscript shaarli_add.sh +# +# Configure your shaarli instance with this: +INSTANCE="https://links.martyoeh.me" + +# send page to shaarli instance and open the 'post' page to edit it +if [ "$#" -gt 0 ]; then + BM="$INSTANCE/bookmarks/new?url=$*&auto_close" +else + BM="$INSTANCE/bookmarks/new?url=$QUTE_URL&auto_close" +fi + +if [ -n "$QUTE_FIFO" ]; then + echo "open -t -r $BM" >>"$QUTE_FIFO" +else + xdg-open "$BM" +fi +