reorganize/refactor example scripts/config / bookmark file etc so that its easier...
[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 if [ -f /usr/share/uzbl/examples/bookmarks ]
4 then
5         file=/usr/share/uzbl/examples/bookmarks
6 else
7         file=./examples/bookmarks #useful when developing
8 fi
9
10 which zenity &>/dev/null || exit 2
11
12 entry=`zenity --entry --text="Add bookmark. add tags at the end, separated by commas" --entry-text="$5"`
13 url=`awk '{print $1}' <<< $entry`
14 # TODO: check if already exists, if so, and tags are different: ask if you want to replace tags
15 echo "$entry" >> $file