fix merge breaking stuff

This commit is contained in:
Squibid 2025-10-24 23:53:56 -04:00
parent 3cf05f2d9a
commit f636efdfe9
Signed by: squibid
GPG key ID: BECE5684D3C4005D
4 changed files with 54 additions and 37 deletions

View file

@ -9,7 +9,6 @@ const wlr = @import("wlroots");
const gpa = std.heap.c_allocator;
const server = &@import("../main.zig").server;
const env_map = &@import("../main.zig").env_map;
pub fn add_keymap(L: *zlua.Lua) i32 {
const nargs: i32 = L.getTop();
@ -26,7 +25,7 @@ pub fn add_keymap(L: *zlua.Lua) i32 {
var keymap: Keymap = undefined;
keymap.options = .{
.on_release = false,
.repeat = true,
};
const mod = L.toString(1) catch {
@ -98,27 +97,3 @@ pub fn get_keybind(L: *zlua.Lua) i32 {
_ = L;
return 0;
}
pub fn spawn(L: *zlua.Lua) i32 {
const nargs: i32 = L.getTop();
if (nargs < 1) {
L.raiseErrorStr("Expected at least one arguments", .{});
return 0;
}
L.checkType(1, .string);
const cmd = L.toString(1) catch {
L.raiseErrorStr("Lua error check your config", .{});
return 0;
};
var child = std.process.Child.init(&[_][]const u8{ "/bin/sh", "-c", cmd }, gpa);
child.env_map = env_map;
child.spawn() catch {
std.log.err("Unable to spawn process \"{s}\"", .{cmd});
};
return 0;
}