diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bukuadd_c | 29 | ||||
-rwxr-xr-x | bin/type.sh | 13 |
2 files changed, 42 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 | ||
4 | url=$(xsel -b) | ||
5 | tags=$(zenity --entry --text="enter tags for $url") | ||
6 | |||
7 | if [[ $? -ne 0 ]]; then | ||
8 | exit 0 | ||
9 | fi | ||
10 | |||
11 | FOO=$(buku --np --nc -p -1) | ||
12 | OUT="$(buku --np --nc -a "$url" "$tags" 2>&1)" | ||
13 | #echo "OUT>$OUT" | ||
14 | if [[ $OUT =~ "ERROR" ]] ; then | ||
15 | notify-send "Bookmarking Failed" "$OUT" --app-name="buku" --icon="dialog-error" | ||
16 | exit 1 | ||
17 | fi | ||
18 | |||
19 | BAR=$FOO | ||
20 | |||
21 | while [[ $BAR == "$FOO" ]]; do | ||
22 | sleep 1 | ||
23 | BAR=$(buku --np --nc -p -1) | ||
24 | #echo "BAR>$BAR" | ||
25 | done; | ||
26 | |||
27 | notify-send "Success" "$BAR" --app-name="buku" --icon="checkmark" | ||
28 | |||
29 | exit 0 | ||
diff --git a/bin/type.sh b/bin/type.sh new file mode 100755 index 0000000..32e0826 --- /dev/null +++ b/bin/type.sh | |||
@@ -0,0 +1,13 @@ | |||
1 | while read line | ||
2 | do | ||
3 | grep -o . <<<$line | while read a | ||
4 | do | ||
5 | sleep 0.$((RANDOM%3)) | ||
6 | #2>&1 echo -n "${a:- }" | tee /dev/tty | ||
7 | echo -n "${a:- }" | tee /dev/tty | ||
8 | done | ||
9 | sleep 0.$((RANDOM%7)) | ||
10 | 1>&2 echo -ne $"\n" | ||
11 | echo | ||
12 | sleep 1.0 | ||
13 | done | ||