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.
This commit is contained in:
Simon Gomizelj 2012-06-07 19:31:07 -04:00
parent 8d71f04b58
commit e365aa19db
1 changed files with 8 additions and 3 deletions

View File

@ -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) {