Spawn a child
This commit is contained in:
parent
5ca93a57ba
commit
e1d1683c3f
@ -14,12 +14,13 @@ pub fn build(b: *Builder) void {
|
||||
const exe = b.addExecutable("zag", "src/main.zig");
|
||||
exe.setTarget(target);
|
||||
exe.setBuildMode(mode);
|
||||
exe.addIncludeDir("protocol");
|
||||
exe.linkLibC();
|
||||
exe.linkSystemLibrary("pixman");
|
||||
exe.addIncludeDir("/usr/include/pixman-1");
|
||||
//exe.linkSystemLibrary("pixman");
|
||||
exe.linkSystemLibrary("wayland-server");
|
||||
exe.linkSystemLibrary("wlroots");
|
||||
exe.linkSystemLibrary("xkbcommon");
|
||||
exe.addIncludeDir("protocol");
|
||||
exe.install();
|
||||
|
||||
const run_cmd = exe.run();
|
||||
|
@ -566,9 +566,14 @@ pub fn main() !void {
|
||||
if (c.setenv("WAYLAND_DISPLAY", socket, 1) == -1) {
|
||||
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 (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 New Issue
Block a user