support "launch <command>" in .xoatrc
This commit is contained in:
13
config.c
13
config.c
@@ -89,6 +89,9 @@ configure()
|
||||
settings.binding_count = sizeof(keys) / sizeof(Binding);
|
||||
settings.bindings = calloc(settings.binding_count, sizeof(Binding));
|
||||
|
||||
settings.launchcmd_count = 0;
|
||||
settings.launchcmds = calloc(1, sizeof(char*));
|
||||
|
||||
for (i = 0; i < settings.binding_count; i++)
|
||||
memmove(&settings.bindings[i], &keys[i], sizeof(Binding));
|
||||
|
||||
@@ -435,6 +438,16 @@ configure()
|
||||
settings.bindings[i].num = num;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (regex_match("^launch[[:space:]]+(.+)$", tmp))
|
||||
{
|
||||
rtrim(regex_matches[1]);
|
||||
|
||||
settings.launchcmd_count++;
|
||||
settings.launchcmds = realloc(settings.launchcmds, sizeof(char*) * settings.launchcmd_count);
|
||||
settings.launchcmds[settings.launchcmd_count-1] = strdup(regex_matches[1]);
|
||||
fprintf(stderr, "launching [%s]\n", regex_matches[1]);
|
||||
}
|
||||
}
|
||||
fclose(file);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user