Initial commit
[uzbl-mobile] / examples / scripts / insert_bookmark.sh
1 #!/bin/bash
2 # you probably want your bookmarks file in your $XDG_DATA_HOME ( eg $HOME/.local/share/uzbl/bookmarks)
3
4 if [ -f /usr/share/uzbl/examples/bookmarks ]
5 then
6         file=/usr/share/uzbl/examples/bookmarks # you will probably get permission denied errors here. pick a file in your ~
7 else
8         file=./examples/bookmarks #useful when developing
9 fi
10
11 which zenity &>/dev/null || exit 2
12
13 entry=`zenity --entry --text="Add bookmark. add tags at the end, separated by commas" --entry-text="$5"`
14 url=`awk '{print $1}' <<< $entry`
15 # TODO: check if already exists, if so, and tags are different: ask if you want to replace tags
16 echo "$entry" >> $file