aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorGravatar Brendan Taylor <whateley@gmail.com>2011-04-12 22:35:42 -0600
committerGravatar Brendan Taylor <whateley@gmail.com>2011-04-12 22:35:42 -0600
commitbdfb2fb35c4d6fa407361dcc99aefb00ff185e6d (patch)
treee61dd35879dbf96de58e375e79546c9c6bbc3a76 /examples
parent1282b9cf99be29db65529eec3bfb14f6685b393b (diff)
allow a second argument to the 'download' command that specifies a destination path
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/data/scripts/download.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/examples/data/scripts/download.sh b/examples/data/scripts/download.sh
index fe566ed..dbc9caf 100755
--- a/examples/data/scripts/download.sh
+++ b/examples/data/scripts/download.sh
@@ -1,9 +1,17 @@
#!/bin/sh
# uzbl's example configuration sets this script up as its download_handler.
-# when uzbl starts a download it runs this script.
+# this script is run when uzbl encounters a URL that it can't display, and when
+# a download is requested using the 'download' command.
+#
# if the script prints a file path to stdout, uzbl will save the download to
-# that path.
-# if nothing is printed to stdout, the download will be cancelled.
+# that path using it's internal downloader.
+#
+# if nothing is printed to stdout, the internal download will be cancelled.
+# you could do your own download handling in your script that way.
+
+# if $5 is set, it is the path that was passed to uzbl's "download" command.
+# we want to use that if it's available.
+[ -n "$5" ] && echo "$5" && exit
. "$UZBL_UTIL_DIR/uzbl-dir.sh"