qutebrowser: Update wallabag userscript

Updated wallabag userscript to be able to both use the current page when
called from qutebrowser or any arbitrary url passed as an argument.
This commit is contained in:
Marty Oehme 2022-03-05 20:15:52 +01:00
parent 26f4cc6062
commit bef798418e
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 37 additions and 23 deletions

View file

@ -1,7 +1,20 @@
#! /usr/bin/bash
#
# Send current page/link to a wallabag instance.
#
# Can be used for sending the current page via:
# :spawn --userscript wallabag_add.sh
# for sending an arbitrary page passed as argument:
# :spawn --userscript wallabag_add.sh https://myinterestingtext.com
# or for sending a hinted link:
# :hint links userscript wallabag_add.sh
#
# Configure your wallabag instance with this:
WALLABAG_INSTANCE="https://read.martyoeh.me"
# from swalladge:
# https://github.com/swalladge/dotfiles/blob/master/local/share/qutebrowser/userscripts/wallabag_add.sh
# v2.*
echo "open https://read.martyoeh.me/bookmarklet?url=$QUTE_URL" >>"$QUTE_FIFO"
# only works for wallabag v2.*
if [ "$#" -gt 0 ]; then
echo "open -b -r $WALLABAG_INSTANCE/bookmarklet?url=$*" >>"$QUTE_FIFO"
else
echo "open -b -r $WALLABAG_INSTANCE/bookmarklet?url=$QUTE_URL" >>"$QUTE_FIFO"
fi