feat: add dinit support

This commit is contained in:
2024-07-26 16:40:46 +02:00
parent 844687809b
commit a32e4a577f
7 changed files with 55 additions and 10 deletions

View File

@@ -9,9 +9,20 @@
#include <ui.h>
#include <users.h>
void chvt(char *arg) {
size_t bsize = snprintf(NULL, 0, "chvt %s", arg) + 1;
char *buf = malloc(bsize);
snprintf(buf, bsize, "chvt %s", arg);
system(buf);
free(buf);
}
int main(int argc, char *argv[]) {
struct config* config = parse_config("/etc/lidm.ini");
if(config == NULL) {
if (argc == 2)
chvt(argv[1]);
struct config *config = parse_config("/etc/lidm.ini");
if (config == NULL) {
fprintf(stderr, "error parsing config\n");
return 1;
}