set font via termite.cfg

This commit is contained in:
Daniel Micay 2012-06-07 12:55:08 -04:00
parent 9748445778
commit abf580c186
3 changed files with 6 additions and 2 deletions

View File

@ -12,7 +12,6 @@ static const char *url_regex = "(ftp|http)s?://[-a-zA-Z0-9.?$%&/=_~#.,:;+]*";
// 0.0: opaque, 1.0: transparent // 0.0: opaque, 1.0: transparent
//#define TRANSPARENCY 0.2 //#define TRANSPARENCY 0.2
static const char *font = "Monospace 9";
static const long scrollback_lines = 1000; static const long scrollback_lines = 1000;
static const char *foreground_color = "#dcdccc"; static const char *foreground_color = "#dcdccc";

View File

@ -283,6 +283,11 @@ static void load_config(GtkWindow *window, VteTerminal *vte) {
IGNORE_ON_ERROR(error) { IGNORE_ON_ERROR(error) {
vte_terminal_set_mouse_autohide(vte, mouse_autohide); vte_terminal_set_mouse_autohide(vte, mouse_autohide);
} }
gchar *font = g_key_file_get_string(config, "options", "font", &error);
IGNORE_ON_ERROR(error) {
vte_terminal_set_font_from_string(vte, font);
}
} }
g_key_file_free(config); g_key_file_free(config);
} }
@ -377,7 +382,6 @@ int main(int argc, char **argv) {
load_config(GTK_WINDOW(window), VTE_TERMINAL(vte)); load_config(GTK_WINDOW(window), VTE_TERMINAL(vte));
vte_terminal_set_scrollback_lines(VTE_TERMINAL(vte), scrollback_lines); vte_terminal_set_scrollback_lines(VTE_TERMINAL(vte), scrollback_lines);
vte_terminal_set_font_from_string(VTE_TERMINAL(vte), font);
vte_terminal_set_cursor_shape(VTE_TERMINAL(vte), CONCAT2(VTE_CURSOR_SHAPE_, CURSOR_SHAPE)); vte_terminal_set_cursor_shape(VTE_TERMINAL(vte), CONCAT2(VTE_CURSOR_SHAPE_, CURSOR_SHAPE));
vte_terminal_set_cursor_blink_mode(VTE_TERMINAL(vte), CONCAT2(VTE_CURSOR_BLINK_, CURSOR_BLINK)); vte_terminal_set_cursor_blink_mode(VTE_TERMINAL(vte), CONCAT2(VTE_CURSOR_BLINK_, CURSOR_BLINK));

View File

@ -5,3 +5,4 @@ scroll_on_keystroke = true
audible_bell = false audible_bell = false
visible_bell = false visible_bell = false
mouse_autohide = false mouse_autohide = false
font = Monospace 9