feat: add LIDM_CONF config path override

This commit is contained in:
2024-09-05 17:36:56 +02:00
parent 730e6db100
commit 7ca864f1d9
3 changed files with 13 additions and 6 deletions

View File

@@ -14,7 +14,8 @@ int main(int argc, char *argv[]) {
if (argc == 2)
chvt_str(argv[1]);
struct config *config = parse_config("/etc/lidm.ini");
char* conf_override = getenv("LIDM_CONF");
struct config *config = parse_config(conf_override == NULL ? "/etc/lidm.ini" : conf_override);
if (config == NULL) {
fprintf(stderr, "error parsing config\n");
return 1;