blob: eadd705aaa1927dbb21542c5b808743bbdbbb0a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#!/usr/bin/env bash
if command -v wl-paste &> /dev/null
then
url=$(wl-paste)
tags=$(yad --entry --text="enter tags for $url")
else
url=$(xsel -b)
tags=$(zenity --entry --text="enter tags for $url")
fi
if [[ $? -ne 0 ]]; then
exit 0
fi
FOO=$(buku --nostdin --np --nc -p -1)
OUT="$(buku --nostdin --np --nc -a "$url" "$tags" 2>&1)"
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 --nostdin --np --nc -p -1)
done
notify-send "Success" "$BAR" --app-name="buku" --icon="checkmark"
exit 0
|