move cursor_blink and cursor_shape to the config

This commit is contained in:
Daniel Micay 2012-06-07 13:36:03 -04:00
parent 727e2e34a5
commit d1f54e57fc
3 changed files with 30 additions and 6 deletions

View File

@ -35,9 +35,6 @@ static const char *colors[16] = {
"#ffffff", // bright white "#ffffff", // bright white
}; };
#define CURSOR_BLINK SYSTEM // SYSTEM, ON or OFF
#define CURSOR_SHAPE BLOCK // BLOCK, UNDERLINE or IBEAM
static const char *term = "vte-256color"; static const char *term = "vte-256color";
// keybindings // keybindings

View File

@ -294,6 +294,30 @@ static void load_config(GtkWindow *window, VteTerminal *vte) {
IGNORE_ON_ERROR(error) { IGNORE_ON_ERROR(error) {
vte_terminal_set_scrollback_lines(vte, scrollback_lines); vte_terminal_set_scrollback_lines(vte, scrollback_lines);
} }
gchar *cursor_blink = g_key_file_get_string(config, "options", "cursor_blink", &error);
IGNORE_ON_ERROR(error) {
if (!strcmp(cursor_blink, "SYSTEM")) {
vte_terminal_set_cursor_blink_mode(vte, VTE_CURSOR_BLINK_SYSTEM);
} else if (!strcmp(cursor_blink, "ON")) {
vte_terminal_set_cursor_blink_mode(vte, VTE_CURSOR_BLINK_ON);
} else if (!strcmp(cursor_blink, "OFF")) {
vte_terminal_set_cursor_blink_mode(vte, VTE_CURSOR_BLINK_OFF);
}
g_free(cursor_blink);
}
gchar *cursor_shape = g_key_file_get_string(config, "options", "cursor_shape", &error);
IGNORE_ON_ERROR(error) {
if (!strcmp(cursor_shape, "BLOCK")) {
vte_terminal_set_cursor_shape(vte, VTE_CURSOR_SHAPE_BLOCK);
} else if (!strcmp(cursor_shape, "IBEAM")) {
vte_terminal_set_cursor_shape(vte, VTE_CURSOR_SHAPE_IBEAM);
} else if (!strcmp(cursor_shape, "UNDERLINE")) {
vte_terminal_set_cursor_shape(vte, VTE_CURSOR_SHAPE_UNDERLINE);
}
g_free(cursor_shape);
}
} }
g_key_file_free(config); g_key_file_free(config);
} }
@ -387,9 +411,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_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));
#ifdef TRANSPARENCY #ifdef TRANSPARENCY
GdkScreen *screen = gtk_widget_get_screen(window); GdkScreen *screen = gtk_widget_get_screen(window);
GdkVisual *visual = gdk_screen_get_rgba_visual(screen); GdkVisual *visual = gdk_screen_get_rgba_visual(screen);

View File

@ -7,3 +7,9 @@ visible_bell = false
mouse_autohide = false mouse_autohide = false
font = Monospace 9 font = Monospace 9
scrollback_lines = 1000 scrollback_lines = 1000
# SYSTEM, ON or OFF
cursor_blink = SYSTEM
# BLOCK, UNDERLINE or IBEAM
cursor_shape = BLOCK