Add keybind to spawn alacritty instance
This commit is contained in:
parent
51e8191031
commit
f1ff381a38
@ -14,11 +14,5 @@ pub fn main() !void {
|
||||
|
||||
try server.start();
|
||||
|
||||
// Spawn an instance of alacritty
|
||||
// const argv = [_][]const u8{ "/bin/sh", "-c", "WAYLAND_DEBUG=1 alacritty" };
|
||||
const argv = [_][]const u8{ "/bin/sh", "-c", "alacritty" };
|
||||
const child = try std.ChildProcess.init(&argv, std.heap.c_allocator);
|
||||
try std.ChildProcess.spawn(child);
|
||||
|
||||
server.run();
|
||||
}
|
||||
|
@ -111,6 +111,13 @@ pub const Server = struct {
|
||||
c.XKB_KEY_Escape => c.wl_display_terminate(self.wl_display),
|
||||
c.XKB_KEY_j => self.root.focusNextView(),
|
||||
c.XKB_KEY_k => self.root.focusPrevView(),
|
||||
c.XKB_KEY_Return => {
|
||||
// Spawn an instance of alacritty
|
||||
// const argv = [_][]const u8{ "/bin/sh", "-c", "WAYLAND_DEBUG=1 alacritty" };
|
||||
const argv = [_][]const u8{ "/bin/sh", "-c", "alacritty" };
|
||||
const child = std.ChildProcess.init(&argv, std.heap.c_allocator) catch unreachable;
|
||||
std.ChildProcess.spawn(child) catch unreachable;
|
||||
},
|
||||
else => return false,
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user