mirror of
https://github.com/swaywm/sway.git
synced 2025-11-17 06:59:48 -05:00
Support runtime var expansion and set at runtime
This commit is contained in:
parent
0f71547032
commit
067fe9d047
3 changed files with 19 additions and 2 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue