From 744c2e2a3eccc3913d7d3e11cc1deec2d6cdb81c Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 17 May 2009 16:08:10 +0200 Subject: [PATCH] order of arguments to scripts --- README | 4 +++- uzbl.c | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README b/README index a43e0cd..41c3def 100644 --- a/README +++ b/README @@ -102,7 +102,7 @@ You can use external scripts with uzbl the following ways: Have a look at the sample configs and scripts! -Scripts that are called by uzbl are passed the following arguments: +Handler scripts that are called by uzbl are passed the following arguments: $1 uzbl-config-file $2 uzbl-pid @@ -135,6 +135,8 @@ The script specific arguments are this: $11 cookie (only with PUT requests) +Custom, userdefined scripts (`spawn foo bar`) get first the arguments as specified in the config and then the above 7 are added at the end. + ### COMMAND LINE ARGUMENTS -u, --uri=URI Uri to load (equivalent to 'set uri = URI') diff --git a/uzbl.c b/uzbl.c index 8ddaf48..b8ac195 100644 --- a/uzbl.c +++ b/uzbl.c @@ -764,6 +764,20 @@ run_command (const char *command, const char *args, const gboolean sync, char ** static void spawn(WebKitWebView *web_view, const char *param) { (void)web_view; +/* + TODO: allow more control over argument order so that users can have some arguments before the default ones from run_command, and some after + gchar** cmd = g_strsplit(param, " ", 2); + gchar * args = NULL; + if (cmd[1]) { + args = g_shell_quote(cmd[1]); + } + if (cmd) { + run_command(cmd[0], args, FALSE, NULL); + } + if (args) { + g_free(args); + } +*/ run_command(param, NULL, FALSE, NULL); } -- 2.11.4.GIT