aboutsummaryrefslogtreecommitdiff
path: root/rootston/config.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-29 10:43:10 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-29 10:43:10 -0400
commitc01248cf17b0556145d973449d0b12cad0b96a8c (patch)
tree8b76fcdbf82ee92ef19504d4a9c0e3abc43f8e1c /rootston/config.c
parentce72a687ce3b88b69b0d319800d2f466205a15f7 (diff)
parent50e86a0efa43fa72bd7d8c2dfc2d124052f74823 (diff)
Merge branch 'master' into feature/xwm-rewrite
Diffstat (limited to 'rootston/config.c')
-rw-r--r--rootston/config.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/rootston/config.c b/rootston/config.c
index 6f81170b..b3fd4f01 100644
--- a/rootston/config.c
+++ b/rootston/config.c
@@ -1,6 +1,7 @@
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
+#include <assert.h>
#include <stdlib.h>
#include <limits.h>
#include <getopt.h>
@@ -244,6 +245,21 @@ static int config_ini_handler(void *user, const char *section, const char *name,
} else {
wlr_log(L_ERROR, "got unknown transform value: %s", value);
}
+ } else if (strcmp(name, "mode") == 0) {
+ char *end;
+ oc->mode.width = strtol(value, &end, 10);
+ assert(*end == 'x');
+ ++end;
+ oc->mode.height = strtol(end, &end, 10);
+ if (*end) {
+ assert(*end == '@');
+ ++end;
+ oc->mode.refresh_rate = strtof(end, &end);
+ assert(strcmp("Hz", end) == 0);
+ }
+ wlr_log(L_DEBUG, "Configured output %s with mode %dx%d@%f",
+ oc->name, oc->mode.width, oc->mode.height,
+ oc->mode.refresh_rate);
}
} else if (strcmp(section, "cursor") == 0) {
if (strcmp(name, "map-to-output") == 0) {