2020-03-19 20:30:38 +00:00
|
|
|
const std = @import("std");
|
2020-03-20 21:44:08 +00:00
|
|
|
const c = @import("c.zig").c;
|
2020-03-19 15:29:22 +00:00
|
|
|
|
2020-03-23 15:50:20 +00:00
|
|
|
const Server = @import("server.zig").Server;
|
|
|
|
|
2020-03-19 15:29:22 +00:00
|
|
|
pub fn main() !void {
|
|
|
|
std.debug.warn("Starting up.\n", .{});
|
|
|
|
|
|
|
|
c.wlr_log_init(c.enum_wlr_log_importance.WLR_DEBUG, null);
|
|
|
|
|
2020-03-23 20:51:46 +00:00
|
|
|
var server = try Server.create(std.heap.c_allocator);
|
|
|
|
|
|
|
|
try server.init();
|
2020-03-23 00:21:15 +00:00
|
|
|
defer server.deinit();
|
2020-03-20 21:44:08 +00:00
|
|
|
|
2020-03-23 00:21:15 +00:00
|
|
|
try server.start();
|
2020-03-20 21:44:08 +00:00
|
|
|
|
2020-03-23 00:21:15 +00:00
|
|
|
// Spawn an instance of alacritty
|
|
|
|
// const argv = [_][]const u8{ "/bin/sh", "-c", "WAYLAND_DEBUG=1 alacritty" };
|
|
|
|
const argv = [_][]const u8{ "/bin/sh", "-c", "alacritty" };
|
2020-03-24 19:35:45 +00:00
|
|
|
const child = try std.ChildProcess.init(&argv, std.heap.c_allocator);
|
2020-03-21 01:34:59 +00:00
|
|
|
try std.ChildProcess.spawn(child);
|
2020-03-20 21:44:08 +00:00
|
|
|
|
2020-03-23 00:21:15 +00:00
|
|
|
server.run();
|
2020-03-19 15:29:22 +00:00
|
|
|
}
|