mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-02 09:01:43 -05:00
feat: support set env in config
This commit is contained in:
parent
fc94c44dab
commit
19b1fe19eb
1 changed files with 9 additions and 0 deletions
|
|
@ -1001,6 +1001,15 @@ void parse_config_line(Config *config, const char *line) {
|
|||
} else {
|
||||
fprintf(stderr, "Error: Invalid monitorrule format: %s\n", value);
|
||||
}
|
||||
} else if (strncmp(key, "env", 3) == 0) {
|
||||
|
||||
char env_type[256], env_value[256];
|
||||
if (sscanf(value, "%[^,],%[^\n]", env_type,env_value) < 2) {
|
||||
fprintf(stderr, "Error: Invalid bind format: %s\n", value);
|
||||
return;
|
||||
}
|
||||
setenv(env_type, env_value, 1);
|
||||
|
||||
} else if (strncmp(key, "bind", 4) == 0) {
|
||||
config->key_bindings =
|
||||
realloc(config->key_bindings,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue