From 067fe9d0472ca24328a962e8704d4e843f2a8af1 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Mon, 4 Jun 2018 22:24:34 -0400 Subject: Support runtime var expansion and set at runtime --- sway/config.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sway/config.c') diff --git a/sway/config.c b/sway/config.c index 445c3d55..f382eefa 100644 --- a/sway/config.c +++ b/sway/config.c @@ -657,6 +657,14 @@ char *do_var_replacement(char *str) { continue; } } + // Unescape double $ and move on + if (find[1] == '$') { + size_t length = strlen(find + 1); + strncpy(find, find + 1, length); + find[length] = '\0'; + find += 2; + continue; + } // Find matching variable for (i = 0; i < config->symbols->length; ++i) { struct sway_variable *var = config->symbols->items[i]; -- cgit v1.2.3