aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-28 00:02:17 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-28 00:02:17 -0400
commit73a64ae0a462241626105906ed6d2a24e62f7b55 (patch)
tree2edf06a39da2330435967575342fe51142538662 /src/config.c
parent7e863cafd9f4c40893eb0e4d9e9883e54ab19255 (diff)
downloadrunes-73a64ae0a462241626105906ed6d2a24e62f7b55.tar.gz
runes-73a64ae0a462241626105906ed6d2a24e62f7b55.zip
make the cursor color configurable
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 09b2542..d81f93e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -26,6 +26,7 @@ void runes_config_cleanup(RunesTerm *t)
int i;
free(t->font_name);
+ cairo_pattern_destroy(t->cursorcolor);
cairo_pattern_destroy(t->mousecursorcolor);
cairo_pattern_destroy(t->fgdefault);
cairo_pattern_destroy(t->bgdefault);
@@ -44,6 +45,7 @@ static void runes_config_set_defaults(RunesTerm *t)
t->audible_bell = 1;
t->bell_is_urgent = 1;
+ t->cursorcolor = cairo_pattern_create_rgb(0.0, 1.0, 0.0);
t->mousecursorcolor = cairo_pattern_create_rgb(1.0, 1.0, 1.0);
t->fgdefault = cairo_pattern_create_rgb(0.827, 0.827, 0.827);
@@ -453,6 +455,14 @@ static void runes_config_set(RunesTerm *t, char *key, char *val)
t->fgdefault = newcolor;
}
}
+ else if (!strcmp(key, "cursorcolor")) {
+ cairo_pattern_t *newcolor;
+ newcolor = runes_config_parse_color(val);
+ if (newcolor) {
+ cairo_pattern_destroy(t->cursorcolor);
+ t->cursorcolor = newcolor;
+ }
+ }
else if (!strcmp(key, "mousecursorcolor")) {
cairo_pattern_t *newcolor;
newcolor = runes_config_parse_color(val);