feat: xorg sessions work

leaves a few TODOs:
* error handling
* properly passing VT around
* `wait_for_x_ready`
* allow compile-time overriding `DEFAULT_XORG_DISPLAY` and `XORG_COMMAND`
This commit is contained in:
2025-09-03 14:50:39 +02:00
parent 570a68c586
commit 64a1368717
5 changed files with 169 additions and 16 deletions

View File

@@ -1,6 +1,9 @@
#ifndef DESKTOP_EXEC_H_
#define DESKTOP_EXEC_H_
#include "macros.h"
int execvpe_desktop(char** args, char* NNULLABLE* NNULLABLE envlist);
int parse_exec_string(const char* exec_s, int* arg_count, char*** args);
void free_parsed_args(int arg_count, char** args);

View File

@@ -4,6 +4,7 @@
#include <sys/types.h>
#include <unistd.h>
#include "desktop_exec.h"
#include "macros.h"
#include "util.h"
@@ -56,7 +57,7 @@ static inline int session_exec_exec(struct session_exec* NNULLABLE exec,
case EXEC_SHELL:
return execle(exec->shell, exec->shell, NULL, envlist);
case EXEC_DESKTOP:
return execve(exec->desktop.args[0], exec->desktop.args, envlist);
return execvpe_desktop(exec->desktop.args, envlist);
default:
__builtin_unreachable();
}