diff --git a/config.h b/config.h index e5a3699..48af579 100644 --- a/config.h +++ b/config.h @@ -7,7 +7,7 @@ #ifdef CLICKABLE_URL static const char *url_regex = "(ftp|http)s?://[-a-zA-Z0-9.?$%&/=_~#.,:;+]*"; -static const char *url_command = "/usr/bin/firefox"; +#define URL_COMMAND(URL_MATCH) {"/usr/bin/firefox", URL_MATCH, NULL} #endif // 0.0: opaque, 1.0: transparent diff --git a/termite.c b/termite.c index bdb3359..0455cc6 100644 --- a/termite.c +++ b/termite.c @@ -135,7 +135,7 @@ static char *check_match(VteTerminal *vte, int event_x, int event_y) { static gboolean button_press_cb(VteTerminal *vte, GdkEventButton *event) { char *match = check_match(vte, event->x, event->y); if (event->button == 1 && event->type == GDK_BUTTON_PRESS && match != NULL) { - const char *argv[3] = {url_command, match, NULL}; + const char *argv[] = URL_COMMAND(match); g_spawn_async(NULL, (char **)argv, NULL, 0, NULL, NULL, NULL, NULL); g_free(match); return TRUE;