Merge remote branch 'remotes/uzbl/master'
[uzbl-mobile] / examples / data / uzbl / scripts / insert_bookmark.sh
1 #!/bin/sh
2
3 [ -d "${XDG_DATA_HOME:-$HOME/.local/share}/uzbl" ] || exit 1
4 file=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/bookmarks
5
6 which zenity &>/dev/null || exit 2
7
8 entry=`zenity --entry --text="Add bookmark. add tags after the '\t', separated by spaces" --entry-text="$6 $7\t"`
9 url=`echo $entry | awk '{print $1}'`
10
11 # TODO: check if already exists, if so, and tags are different: ask if you want to replace tags
12 echo "$entry" >/dev/null #for some reason we need this.. don't ask me why
13 echo -e "$entry"  >> $file
14 true