From ea211500227aa58f5e495777743c5d391cbc3110 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sun, 17 Mar 2019 23:09:49 +0300 Subject: Initial commit --- bin/bukuadd_c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 bin/bukuadd_c (limited to 'bin/bukuadd_c') diff --git a/bin/bukuadd_c b/bin/bukuadd_c new file mode 100755 index 0000000..d4e1a3d --- /dev/null +++ b/bin/bukuadd_c @@ -0,0 +1,29 @@ +#!/bin/bash + +#set -e +url=$(xsel -b) +tags=$(zenity --entry --text="enter tags for $url") + +if [[ $? -ne 0 ]]; then + exit 0 +fi + +FOO=$(buku --np --nc -p -1) +OUT="$(buku --np --nc -a "$url" "$tags" 2>&1)" +#echo "OUT>$OUT" +if [[ $OUT =~ "ERROR" ]] ; then + notify-send "Bookmarking Failed" "$OUT" --app-name="buku" --icon="dialog-error" + exit 1 +fi + +BAR=$FOO + +while [[ $BAR == "$FOO" ]]; do + sleep 1 + BAR=$(buku --np --nc -p -1) + #echo "BAR>$BAR" +done; + +notify-send "Success" "$BAR" --app-name="buku" --icon="checkmark" + +exit 0 -- cgit v1.2.3-70-g09d2