34 lines
684 B
C
34 lines
684 B
C
#include <stdio.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
#include <signal.h>
|
|
#include <wayland-util.h>
|
|
#include <wlr/util/log.h>
|
|
#include "server.h"
|
|
#include "die.h"
|
|
|
|
void destroy(struct server *server) {
|
|
wlr_backend_destroy(server->backend);
|
|
wl_display_destroy(server->wl_display);
|
|
}
|
|
|
|
int main(void) {
|
|
if (!getenv("XDG_RUNTIME_DIR"))
|
|
die("XDG_RUNTIME_DIR must be set", 0);
|
|
|
|
int sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};
|
|
for (size_t i = 0; i < sizeof(sig) / sizeof(sig[0]); i++)
|
|
signal(sig[i], NULL);
|
|
|
|
wlr_log_init(LOG_LEVEL, NULL);
|
|
|
|
struct server server;
|
|
server_init(&server);
|
|
|
|
wl_display_run(server.wl_display);
|
|
destroy(&server);
|
|
|
|
return 0;
|
|
}
|