1 /* logjam - a GTK client for LiveJournal.
2 * Copyright (C) 2000-2003 Evan Martin <evan@livejournal.com>
4 * vim: tabstop=4 shiftwidth=4 noexpandtab :
13 #include <sys/types.h>
20 /* http://lxr.mozilla.org/seamonkey/source/xpfe/bootstrap/nsAppRunner.cpp#1413
21 * when sending remote commands,
22 * mozilla returns 0 on success and nonzero on failure. */
23 const CommandList spawn_commands
[] = {
24 {"Firefox", "firefox '%s'"},
25 //{"Opera", "opera -remote 'openURL(%s,new-window)' || opera '%s'"},
26 {"Opera", "opera '%s'"},
27 //{"Mozilla", "mozilla -remote 'openURL(%s, new-window)' || mozilla '%s'"},
28 {"Mozilla", "mozilla '%s'"},
33 void spawn_url (GtkWindow
*parent
, const char *url
) {
36 char *argv
[4] = { "/bin/sh", "-c", NULL
, NULL
};
37 /* and now, a hack because I don't know how many %s's are in spawn_command. */
38 #define ARGS_HACK url,url,url,url,url,url
39 cmd
= g_strdup_printf(conf
.spawn_command
, ARGS_HACK
);
41 if (!g_spawn_async(NULL
, argv
, NULL
, 0, NULL
, NULL
, NULL
, &err
)) {
42 jam_warning(parent
, _("Error spawning URL '%s': %s\n"), url
, err
->message
);