Spawn a child
This commit is contained in:
parent
5ca93a57ba
commit
e1d1683c3f
2 changed files with 9 additions and 3 deletions
|
@ -14,12 +14,13 @@ pub fn build(b: *Builder) void {
|
||||||
const exe = b.addExecutable("zag", "src/main.zig");
|
const exe = b.addExecutable("zag", "src/main.zig");
|
||||||
exe.setTarget(target);
|
exe.setTarget(target);
|
||||||
exe.setBuildMode(mode);
|
exe.setBuildMode(mode);
|
||||||
|
exe.addIncludeDir("protocol");
|
||||||
exe.linkLibC();
|
exe.linkLibC();
|
||||||
exe.linkSystemLibrary("pixman");
|
exe.addIncludeDir("/usr/include/pixman-1");
|
||||||
|
//exe.linkSystemLibrary("pixman");
|
||||||
exe.linkSystemLibrary("wayland-server");
|
exe.linkSystemLibrary("wayland-server");
|
||||||
exe.linkSystemLibrary("wlroots");
|
exe.linkSystemLibrary("wlroots");
|
||||||
exe.linkSystemLibrary("xkbcommon");
|
exe.linkSystemLibrary("xkbcommon");
|
||||||
exe.addIncludeDir("protocol");
|
|
||||||
exe.install();
|
exe.install();
|
||||||
|
|
||||||
const run_cmd = exe.run();
|
const run_cmd = exe.run();
|
||||||
|
|
|
@ -566,9 +566,14 @@ pub fn main() !void {
|
||||||
if (c.setenv("WAYLAND_DISPLAY", socket, 1) == -1) {
|
if (c.setenv("WAYLAND_DISPLAY", socket, 1) == -1) {
|
||||||
return ZagError.CantSetEnv;
|
return ZagError.CantSetEnv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const argv = [_][]const u8{ "/bin/sh", "-c", "alacritty" };
|
||||||
|
var child = try std.ChildProcess.init(&argv, std.heap.c_allocator);
|
||||||
|
try std.ChildProcess.spawn(child);
|
||||||
//if (startup_cmd) {
|
//if (startup_cmd) {
|
||||||
//if (std.os.linux.fork() == 0) {
|
//if (std.os.linux.fork() == 0) {
|
||||||
//execl("/bin/sh", "/bin/sh", "-c", startup_cmd, (void *)NULL);
|
// execl("/bin/sh", "/bin/sh", "-c", startup_cmd, (void *)NULL);
|
||||||
|
// std.os.linux.execve("/bin/sh",
|
||||||
//}
|
//}
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue