mirror of
https://github.com/javalsai/lidm.git
synced 2025-09-01 02:47:59 +02:00
feat: add dinit support
This commit is contained in:
15
src/main.c
15
src/main.c
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user