From 7419b9fc45ba291d5d10a9f5bea3fa5d33dfedc0 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 16 Sep 2020 15:22:27 +0300 Subject: move bin to .local/bin --- .local/bin/bukuadd_c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 .local/bin/bukuadd_c (limited to '.local/bin/bukuadd_c') diff --git a/.local/bin/bukuadd_c b/.local/bin/bukuadd_c new file mode 100755 index 0000000..d4e1a3d --- /dev/null +++ b/.local/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