diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-05-01 19:00:34 +0200 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-05-01 19:00:34 +0200 |
commit | 69c69e9ee76e8fdc973de03debb6d9a4aa053b7a (patch) | |
tree | 6269f51550df221d625a079bebebd646aeeb2ad2 /uzbl.c | |
parent | 0b53140ea0f7f27b0931766b345b76fe4208478d (diff) | |
parent | 73130c8b21549668c7af582cbed8d1af4a67ee4e (diff) |
merged in dusans stuff
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -66,6 +66,7 @@ static gint load_progress; static Window xwin = 0; static char fifo_path[64]; static char socket_path[108]; +static char executable_path[500]; static GString* keycmd; /* state variables (initial values coming from command line arguments but may be changed later) */ @@ -363,21 +364,18 @@ load_uri (WebKitWebView * web_view, const gchar *param) { static void new_window_load_uri (const gchar * uri) { GString* to_execute = g_string_new (""); - if (!config_file) { - g_string_printf (to_execute, "uzbl --uri '%s'", uri); - } else { - g_string_printf (to_execute, "uzbl --uri '%s' --config '%s'", uri, config_file); - } - printf("Spawning %s\n",to_execute->str); - if (!g_spawn_command_line_async (to_execute->str, NULL)) { - if (!config_file) { - g_string_printf (to_execute, "./uzbl --uri '%s'", uri); - } else { - g_string_printf (to_execute, "./uzbl --uri '%s' --config '%s'", uri, config_file); + g_string_append_printf (to_execute, "%s --uri '%s'", executable_path, uri); + int i; + for (i = 0; entries[i].long_name != NULL; i++) { + if ((entries[i].arg == G_OPTION_ARG_STRING) && (strcmp(entries[i].long_name,"uri")!=0)) { + gchar** str = (gchar**)entries[i].arg_data; + if (*str!=NULL) { + g_string_append_printf (to_execute, " --%s '%s'", entries[i].long_name, *str); + } } - printf("Spawning %s\n",to_execute->str); - g_spawn_command_line_async (to_execute->str, NULL); } + printf("\n%s\n", to_execute->str); + g_spawn_command_line_async (to_execute->str, NULL); g_string_free (to_execute, TRUE); } @@ -800,6 +798,7 @@ main (int argc, char* argv[]) { g_thread_init (NULL); printf("Uzbl start location: %s\n", argv[0]); + strcpy(executable_path,argv[0]); strcat ((char *) XDG_CONFIG_HOME_default, getenv ("HOME")); strcat ((char *) XDG_CONFIG_HOME_default, "/.config"); |