diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-08-23 15:26:41 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-08-23 15:26:41 +0000 |
| commit | 7026f6071752423ed55d3e7dfa0b4112d39efb9a (patch) | |
| tree | 88a8284ef33767adb358447beca5262634604104 /config.c | |
| parent | main: use slave's exit value as our exit value (diff) | |
add config + command line option for setting initial window width/height
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -159,6 +159,19 @@ parse_section_main(const char *key, const char *value, struct config *conf, conf->shell = strdup(value); } + else if (strcmp(key, "geometry") == 0) { + unsigned width, height; + if (sscanf(value, "%ux%u", &width, &height) != 2 || width == 0 || height == 0) { + LOG_ERR( + "%s: %d: expected WIDTHxHEIGHT, where both are positive integers: %s", + path, lineno, value); + return false; + } + + conf->width = width; + conf->height = height; + } + else if (strcmp(key, "font") == 0) { char *copy = strdup(value); for (const char *font = strtok(copy, ","); font != NULL; font = strtok(NULL, ",")) @@ -440,6 +453,8 @@ config_load(struct config *conf) *conf = (struct config) { .term = strdup("foot"), .shell = get_shell(), + .width = -1, + .height = -1, .fonts = tll_init(), .scrollback_lines = 1000, |
