diff options
author | DuClare <akarinotengoku@gmail.com> | 2009-05-16 20:31:49 +0300 |
---|---|---|
committer | DuClare <akarinotengoku@gmail.com> | 2009-05-16 20:31:49 +0300 |
commit | 10431d4146cdd27c46db1dc9f2b54cb44fab4797 (patch) | |
tree | e2f9c295c36a002eafd6c258c5deb5c76a6193bc /uzbl.c | |
parent | 6c45107e12bc8a3971cad1b0a6d5cd59d4366315 (diff) |
Add action: sh, add var: shell_cmd
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -82,6 +82,7 @@ const struct { { "http_debug", (void *)&uzbl.behave.http_debug }, { "default_font_size", (void *)&uzbl.behave.default_font_size }, { "minimum_font_size", (void *)&uzbl.behave.minimum_font_size }, + { "shell_cmd", (void *)&uzbl.behave.shell_cmd }, { "proxy_url", (void *)&uzbl.net.proxy_url }, { "max_conns", (void *)&uzbl.net.max_conns }, { "max_conns_host", (void *)&uzbl.net.max_conns_host }, @@ -401,6 +402,7 @@ static struct {char *name; Command command;} cmdlist[] = { "script", run_js }, { "toggle_status", toggle_status_cb }, { "spawn", spawn }, + { "sh", spawn_sh }, { "exit", close_uzbl }, { "search", search_text }, { "insert_mode", set_insert_mode }, @@ -735,6 +737,14 @@ spawn(WebKitWebView *web_view, const char *param) { } static void +spawn_sh(WebKitWebView *web_view, const char *param) { + (void)web_view; + gchar *cmd = g_strdup_printf(uzbl.behave.shell_cmd, param); + spawn(NULL, cmd); + g_free(cmd); +} + +static void parse_command(const char *cmd, const char *param) { Command c; @@ -869,6 +879,10 @@ set_var_value(gchar *name, gchar *val) { if(*p) free(*p); *p = set_useragent(g_strdup(val)); } + else if(var_is("shell_cmd", name)) { + if(*p) free(*p); + *p = g_strdup(val); + } /* variables that take int values */ else { int *ip = (int *)p; |