diff --git a/qutebrowser/.config/qutebrowser/maps.py b/qutebrowser/.config/qutebrowser/maps.py index 9aabbb1..e3daae5 100644 --- a/qutebrowser/.config/qutebrowser/maps.py +++ b/qutebrowser/.config/qutebrowser/maps.py @@ -17,28 +17,28 @@ config.bind("", "command-history-next", mode="command") config.bind("", "command-history-prev", mode="command") config.bind("", "completion-item-focus prev", mode="command") config.bind("", "completion-item-focus next", mode="command") -config.bind('', 'rl-backward-kill-word', mode='command') -config.bind('', 'rl-kill-word', mode='command') -config.bind('', 'rl-forward-word', mode='command') -config.bind('', 'rl-delete-char', mode='command') -config.bind('', 'rl-beginning-of-line', mode='command') -config.bind('', 'rl-backward-char', mode='command') -config.bind('', 'completion-item-yank', mode='command') -config.bind('', 'completion-item-del', mode='command') -config.bind('', 'rl-end-of-line', mode='command') -config.bind('', 'rl-forward-char', mode='command') -config.bind('', 'rl-backward-delete-char', mode='command') -config.bind('', 'completion-item-focus prev-category', mode='command') -config.bind('', 'completion-item-focus next-category', mode='command') -config.bind('', 'rl-unix-line-discard', mode='command') -config.bind('', 'rl-unix-word-rubout', mode='command') -config.bind('', 'rl-yank', mode='command') +config.bind("", "rl-backward-kill-word", mode="command") +config.bind("", "rl-kill-word", mode="command") +config.bind("", "rl-forward-word", mode="command") +config.bind("", "rl-delete-char", mode="command") +config.bind("", "rl-beginning-of-line", mode="command") +config.bind("", "rl-backward-char", mode="command") +config.bind("", "completion-item-yank", mode="command") +config.bind("", "completion-item-del", mode="command") +config.bind("", "rl-end-of-line", mode="command") +config.bind("", "rl-forward-char", mode="command") +config.bind("", "rl-backward-delete-char", mode="command") +config.bind("", "completion-item-focus prev-category", mode="command") +config.bind("", "completion-item-focus next-category", mode="command") +config.bind("", "rl-unix-line-discard", mode="command") +config.bind("", "rl-unix-word-rubout", mode="command") +config.bind("", "rl-yank", mode="command") ## ADDED # toggles ('cycles') between tabs always showing, or only when switching between them config.bind( leader + "tt", - "config-cycle -t tabs.show always switching ;; config-cycle -t statusbar.show in-mode always", + "config-cycle -t tabs.show always switching ;; config-cycle -t statusbar.show always in-mode", ) config.bind(leader + "th", "set tabs.position bottom") config.bind(leader + "tH", "set tabs.position top") @@ -63,7 +63,8 @@ config.bind(lleader + "dp", "save_to_pdf", mode="normal") # open last download config.bind("gD", "spawn --userscript open_download") -config.bind('"w', "add-wallabag", 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('"a', "send-to-archive", mode="normal") diff --git a/qutebrowser/.local/share/qutebrowser/userscripts/wallabag_add.sh b/qutebrowser/.local/share/qutebrowser/userscripts/wallabag_add.sh index 7b04ff3..18c373f 100755 --- a/qutebrowser/.local/share/qutebrowser/userscripts/wallabag_add.sh +++ b/qutebrowser/.local/share/qutebrowser/userscripts/wallabag_add.sh @@ -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