diff options
author | EuAndreh <eu@euandre.org> | 2019-01-21 09:19:32 -0200 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-01-21 09:19:32 -0200 |
commit | 01228f89c43d9a40f79eb8e2e9556d8d9fa01fc7 (patch) | |
tree | 89c71df00fe64542a46a9c215124aee68969320c /scripts | |
parent | urls. (diff) | |
download | dotfiles-01228f89c43d9a40f79eb8e2e9556d8d9fa01fc7.tar.gz dotfiles-01228f89c43d9a40f79eb8e2e9556d8d9fa01fc7.tar.xz |
WIP: add extra keybindings for Buku actions.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/buku-archive.sh | 15 | ||||
-rwxr-xr-x | scripts/buku-delete.sh | 14 |
2 files changed, 29 insertions, 0 deletions
diff --git a/scripts/buku-archive.sh b/scripts/buku-archive.sh new file mode 100755 index 0000000..5af56a0 --- /dev/null +++ b/scripts/buku-archive.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -x + +SEL="$(xsel)" +BOOKMARK_ID="$(buku "$SEL" -f 1 --tacit | tail -n +2 | awk '{print $1}')" +# tail to trim unwanted "waiting for input" output from buku https://github.com/jarun/Buku/blob/d60d56bc9f7f5e1410e99dc8bb4e35abf5068a14/buku#L4619 + +if [[ ! -z "$BOOKMARK_ID" ]]; then + echo "Archiving $BOOKMARK_ID." + buku -u "$BOOKMARK_ID" --tag - ril + buku -u "$BOOKMARK_ID" --tag + simple-archive +else + echo "Bookmark for '$SEL' not found." + exit 1 +fi diff --git a/scripts/buku-delete.sh b/scripts/buku-delete.sh new file mode 100755 index 0000000..3e2f3dd --- /dev/null +++ b/scripts/buku-delete.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -x + +SEL="$(xsel)" +BOOKMARK_ID="$(buku "$SEL" -f 1 --tacit | tail -n +2 | awk '{print $1}')" +# tail to trim unwanted "waiting for input" output from buku https://github.com/jarun/Buku/blob/d60d56bc9f7f5e1410e99dc8bb4e35abf5068a14/buku#L4619 + +if [[ ! -z "$BOOKMARK_ID" ]]; then + echo "Deleting $BOOKMARK_ID." + buku -d "$BOOKMARK_ID" --tacit +else + echo "Bookmark for '$SEL' not found." + exit 1 +fi |