diff options
Diffstat (limited to 'examples/scripts')
-rwxr-xr-x | examples/scripts/download.sh | 2 | ||||
-rwxr-xr-x | examples/scripts/history.sh | 4 | ||||
-rwxr-xr-x | examples/scripts/insert_bookmark.sh | 15 | ||||
-rwxr-xr-x | examples/scripts/load_url_from_bookmarks.sh | 12 | ||||
-rwxr-xr-x | examples/scripts/load_url_from_history.sh | 6 |
5 files changed, 39 insertions, 0 deletions
diff --git a/examples/scripts/download.sh b/examples/scripts/download.sh new file mode 100755 index 0000000..ff3d8db --- /dev/null +++ b/examples/scripts/download.sh @@ -0,0 +1,2 @@ +#!/bin/bash +wget $5 diff --git a/examples/scripts/history.sh b/examples/scripts/history.sh new file mode 100755 index 0000000..03c568a --- /dev/null +++ b/examples/scripts/history.sh @@ -0,0 +1,4 @@ +#!/bin/bash +#TODO: strip 'http://' part +# you probably really want this in your $XDG_DATA_HOME (eg $HOME/.local/share/uzbl/history) +echo "$7 $5" >> /tmp/uzbl.history diff --git a/examples/scripts/insert_bookmark.sh b/examples/scripts/insert_bookmark.sh new file mode 100755 index 0000000..af6ca8a --- /dev/null +++ b/examples/scripts/insert_bookmark.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# you probably want your bookmarks file in your $XDG_DATA_HOME ( eg $HOME/.local/share/uzbl/bookmarks) +if [ -f /usr/share/uzbl/examples/bookmarks ] +then + file=/usr/share/uzbl/examples/bookmarks +else + file=./examples/bookmarks #useful when developing +fi + +which zenity &>/dev/null || exit 2 + +entry=`zenity --entry --text="Add bookmark. add tags at the end, separated by commas" --entry-text="$5"` +url=`awk '{print $1}' <<< $entry` +# TODO: check if already exists, if so, and tags are different: ask if you want to replace tags +echo "$entry" >> $file diff --git a/examples/scripts/load_url_from_bookmarks.sh b/examples/scripts/load_url_from_bookmarks.sh new file mode 100755 index 0000000..fd9179e --- /dev/null +++ b/examples/scripts/load_url_from_bookmarks.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# you probably want your bookmarks file in your $XDG_DATA_HOME ( eg $HOME/.local/share/uzbl/bookmarks) +if [ -f /usr/share/uzbl/examples/bookmarks ] +then + file=/usr/share/uzbl/examples/bookmarks +else + file=./examples/bookmarks #useful when developing +fi + +goto=`awk '{print $1}' $history_file | dmenu` #NOTE: it's the job of the script that inserts bookmarks to make sure there are no dupes. +[ -n "$goto" ] && echo "uri $goto" > $4 diff --git a/examples/scripts/load_url_from_history.sh b/examples/scripts/load_url_from_history.sh new file mode 100755 index 0000000..366aedf --- /dev/null +++ b/examples/scripts/load_url_from_history.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# you probably really want this in your $XDG_DATA_HOME (eg $HOME/.local/share/uzbl/history) +history_file=/tmp/uzbl.history + +goto=`awk '{print $3}' $history_file | sort | uniq | dmenu` +[ -n "$goto" ] && echo "uri $goto" > $4 |