aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/insert_bookmark.sh
blob: 5d411312ce32cb0e39069c1f468b7c12f7b2a136 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

. "$UZBL_UTIL_DIR/uzbl-dir.sh"
. "$UZBL_UTIL_DIR/uzbl-util.sh"

>> "$UZBL_BOOKMARKS_FILE" || exit 1

which zenity >/dev/null 2>&1 || exit 2

tags="$( zenity --entry --text="Enter space-separated tags for bookmark $UZBL_URI:" )"
exitstatus="$?"
[ "$exitstatus" -eq 0 ] || exit "$exitstatus"

# TODO: check if already exists, if so, and tags are different: ask if you want to replace tags
print "$UZBL_URI $tags\n" >> "$UZBL_BOOKMARKS_FILE"