summaryrefslogtreecommitdiffstats
path: root/bin/bukuadd_c
diff options
context:
space:
mode:
authorYigit Sever2019-03-17 23:09:49 +0300
committerYigit Sever2019-03-17 23:18:28 +0300
commitea211500227aa58f5e495777743c5d391cbc3110 (patch)
treeafa2b455f9fea40b45dbf8a742c0d0d498024edb /bin/bukuadd_c
downloaddotfiles-ea211500227aa58f5e495777743c5d391cbc3110.tar.gz
dotfiles-ea211500227aa58f5e495777743c5d391cbc3110.tar.bz2
dotfiles-ea211500227aa58f5e495777743c5d391cbc3110.zip
Initial commit
Diffstat (limited to 'bin/bukuadd_c')
-rwxr-xr-xbin/bukuadd_c29
1 files changed, 29 insertions, 0 deletions
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 @@
1#!/bin/bash
2
3#set -e
4url=$(xsel -b)
5tags=$(zenity --entry --text="enter tags for $url")
6
7if [[ $? -ne 0 ]]; then
8 exit 0
9fi
10
11FOO=$(buku --np --nc -p -1)
12OUT="$(buku --np --nc -a "$url" "$tags" 2>&1)"
13#echo "OUT>$OUT"
14if [[ $OUT =~ "ERROR" ]] ; then
15 notify-send "Bookmarking Failed" "$OUT" --app-name="buku" --icon="dialog-error"
16 exit 1
17fi
18
19BAR=$FOO
20
21while [[ $BAR == "$FOO" ]]; do
22 sleep 1
23 BAR=$(buku --np --nc -p -1)
24 #echo "BAR>$BAR"
25done;
26
27notify-send "Success" "$BAR" --app-name="buku" --icon="checkmark"
28
29exit 0