aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/scripts
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-04-27 21:25:35 +0200
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-04-27 21:25:35 +0200
commite04b4d1628000f185e4499c0bdd9d5a5a610fd15 (patch)
treeda52fc8217226182bfd62bc51bf91840fea7ae35 /examples/scripts
parentda781760634d94c61dc268e3866f896cf9a50b7e (diff)
reorganize/refactor example scripts/config / bookmark file etc so that its easier for new users + separate config for development
Diffstat (limited to 'examples/scripts')
-rwxr-xr-xexamples/scripts/download.sh2
-rwxr-xr-xexamples/scripts/history.sh4
-rwxr-xr-xexamples/scripts/insert_bookmark.sh15
-rwxr-xr-xexamples/scripts/load_url_from_bookmarks.sh12
-rwxr-xr-xexamples/scripts/load_url_from_history.sh6
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