Support runtime var expansion and set at runtime

This commit is contained in:
Brian Ashworth 2018-06-04 22:24:34 -04:00
parent 0f71547032
commit 067fe9d047
3 changed files with 19 additions and 2 deletions

View file

@ -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];