From abde786e380ed8526cd2a78a5273938732eaff15 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 20 Dec 2019 12:21:57 +0100 Subject: [PATCH] Add shaarli quick add bookmarklet to qutebrowser Invoked by leader + bs (for bookmark shaarli); opens up the post page of shaarli (hardcoded to my personal instance for now). --- .config/qutebrowser/config.py | 7 +++++-- .local/share/qutebrowser/userscripts/shaarli_add.sh | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 .local/share/qutebrowser/userscripts/shaarli_add.sh diff --git a/.config/qutebrowser/config.py b/.config/qutebrowser/config.py index 6d461f9..ce22e40 100644 --- a/.config/qutebrowser/config.py +++ b/.config/qutebrowser/config.py @@ -116,8 +116,11 @@ c.aliases["e"] = "session-load" # bookmarklet aliases: # currently the idea is to prefix bookmarklets with b (as in open "bookmarklet") # wallabag add current page, either with walla command, or bw -c.aliases["wallabag-add"] = "spawn --userscript wallabag_add.sh" -config.bind(leader + 'bw', 'wallabag-add', mode='normal') +c.aliases["add-wallabag"] = "spawn --userscript wallabag_add.sh" +config.bind(leader + 'bw', 'add-wallabag', mode='normal') +# add to (my) shaarli instance +c.aliases["add-shaarli"] = "spawn --userscript shaarli_add.sh" +config.bind(leader + 'bs', 'add-shaarli', mode='normal') # re-opens the current page on the web archive overview page c.aliases["archive-open"] = "open https://web.archive.org/web/{url}" config.bind(leader + 'ba', 'archive-open', mode='normal') diff --git a/.local/share/qutebrowser/userscripts/shaarli_add.sh b/.local/share/qutebrowser/userscripts/shaarli_add.sh new file mode 100755 index 0000000..01660af --- /dev/null +++ b/.local/share/qutebrowser/userscripts/shaarli_add.sh @@ -0,0 +1,4 @@ +#! /usr/bin/bash + +# send current page to my personal shaarli instance and open the 'post' page to edit it +echo "open https://links.martyoeh.me/?post=$QUTE_URL" >>"$QUTE_FIFO"