2023-08-08 09:54:44 +00:00
|
|
|
#! /usr/bin/env bash
|
2022-03-05 19:15:52 +00:00
|
|
|
#
|
|
|
|
# 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"
|
2019-05-28 09:10:03 +00:00
|
|
|
|
2022-03-05 19:15:52 +00:00
|
|
|
# only works for wallabag v2.*
|
|
|
|
if [ "$#" -gt 0 ]; then
|
2023-08-08 09:54:44 +00:00
|
|
|
BM="$WALLABAG_INSTANCE/bookmarklet?url=$*"
|
2022-03-05 19:15:52 +00:00
|
|
|
else
|
2023-08-08 09:54:44 +00:00
|
|
|
BM="$WALLABAG_INSTANCE/bookmarklet?url=$QUTE_URL"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$QUTE_FIFO" ]; then
|
|
|
|
echo "open -b -r $BM" >>"$QUTE_FIFO"
|
|
|
|
else
|
|
|
|
xdg-open "$BM"
|
2022-03-05 19:15:52 +00:00
|
|
|
fi
|