aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/insert_bookmark.sh
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2010-11-24 12:43:42 -0700
committerGravatar Brendan Taylor <whateley@gmail.com>2010-11-24 12:43:42 -0700
commitb4cfab85863b9fc14cfd3f890b53a9253841010d (patch)
tree3cdf0cca0403410ec5ba20ecde9b5fa8b74122ae /examples/data/scripts/insert_bookmark.sh
parente660b9de3f4331ebf171735b40eb12105218b2d7 (diff)
insert_bookmark.sh was totally busted
Diffstat (limited to 'examples/data/scripts/insert_bookmark.sh')
-rwxr-xr-xexamples/data/scripts/insert_bookmark.sh13
1 files changed, 5 insertions, 8 deletions
diff --git a/examples/data/scripts/insert_bookmark.sh b/examples/data/scripts/insert_bookmark.sh
index 08d7d2b..9303b85 100755
--- a/examples/data/scripts/insert_bookmark.sh
+++ b/examples/data/scripts/insert_bookmark.sh
@@ -1,19 +1,16 @@
#!/bin/sh
+source $UZBL_UTIL_DIR/uzbl-args.sh
source $UZBL_UTIL_DIR/uzbl-dir.sh
[ -d "$UZBL_DATA_DIR" ] || exit 1
[ -w "$UZBL_BOOKMARKS_FILE" ] || [ ! -a "$UZBL_BOOKMARKS_FILE" ] || exit 1
which zenity &>/dev/null || exit 2
-# replace tabs, they are pointless in titles and we want to use tabs as delimiter.
-title=$(echo "$UZBL_TITLE" | sed 's/\t/ /')
-entry=$(zenity --entry --text="Add bookmark. add tags after the '\t', separated by spaces" --entry-text="$UZBL_URL $title\t")
+
+tags=$(zenity --entry --text="Enter space-separated tags for bookmark $UZBL_URL:")
exitstatus=$?
-if [ $exitstatus -ne 0 ]; then exit $exitstatus; fi
-url=$(echo $entry | awk '{print $1}')
+[ $exitstatus -eq 0 ] || exit $exitstatus
# TODO: check if already exists, if so, and tags are different: ask if you want to replace tags
-echo "$entry" >/dev/null #for some reason we need this.. don't ask me why
-echo -e "$entry" >> $UZBL_BOOKMARKS_FILE
-true
+echo "$UZBL_URL $tags" >> "$UZBL_BOOKMARKS_FILE"