From e365aa19dbdd5d565b80ac4c4165f9d0f39699a5 Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Thu, 7 Jun 2012 19:31:07 -0400 Subject: [PATCH] Add a browser configuration setting. Add "browser" to termite.cfg to hardcode the URL to launch links with. If its not set, query BROWSER environmental variable. --- termite.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/termite.c b/termite.c index 00e63f5..59d28cf 100644 --- a/termite.c +++ b/termite.c @@ -290,6 +290,14 @@ static void load_config(GtkWindow *window, VteTerminal *vte, if (get_config_boolean(config, "options", "clickable_url", &cfgbool)) *clickable_url = cfgbool; + if (get_config_string(config, "options", "browser", &cfgstr)) { + browser_cmd[0] = cfgstr; + } else { + browser_cmd[0] = g_getenv("BROWSER"); + if (!browser_cmd[0]) *clickable_url = false; + } + + if (get_config_string(config, "options", "font", &cfgstr)) { vte_terminal_set_font_from_string(vte, cfgstr); g_free(cfgstr); @@ -416,9 +424,6 @@ int main(int argc, char **argv) { command_argv = default_argv; } - browser_cmd[0] = g_getenv("BROWSER"); - if (!browser_cmd[0]) browser_cmd[0] = default_browser; - VtePty *pty = vte_terminal_pty_new(VTE_TERMINAL(vte), VTE_PTY_DEFAULT, &error); if (!pty) {