From 56c1f04cc642b1576530b2460dc44d23efde6c6f Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 30 May 2012 13:56:40 -0400 Subject: [PATCH] more flexible url command --- config.h | 2 +- termite.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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;