From 71a5350b681e022e9738b50f2977ddb529110bfb Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Sat, 26 Mar 2016 12:31:53 +0100 Subject: Implement include command The include command (`include `) makes it possible to include sub config files from the main config file (or from within other sub config files). The include command uses the following rules for including config files: * the `path` can be either a full path or a path that is relative to the parent config. Shell expansion is supported, so it's possible to do `include ~/.config/sway.d/*`. * The same config file can only be included once (to prevent include cycles). If a config is included multiple times it will just be ignored after it has been included once. * Including a sub config file is the same as inserting the content of that file into the parent config, thus rules about overwriting bindsyms etc. works the same as for a single config. Implement #542 --- sway/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sway/main.c') diff --git a/sway/main.c b/sway/main.c index c4a5d497..4aaac556 100644 --- a/sway/main.c +++ b/sway/main.c @@ -206,11 +206,11 @@ int main(int argc, char **argv) { init_layout(); if (validate) { - bool valid = load_config(config_path); + bool valid = load_main_config(config_path, false); return valid ? 0 : 1; } - if (!load_config(config_path)) { + if (!load_main_config(config_path, false)) { sway_terminate(EXIT_FAILURE); } -- cgit v1.2.3