From e55d40ab106d6273cac6a304af238f8c6c1e89f7 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 29 Mar 2020 14:07:39 +0200 Subject: [PATCH] Swap bindngs for send to top and start terminal --- src/server.zig | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/server.zig b/src/server.zig index dca5e9a..7281ae8 100644 --- a/src/server.zig +++ b/src/server.zig @@ -112,16 +112,6 @@ pub const Server = struct { // This function assumes the proper modifier is held down. if (modifiers & @intCast(u32, c.WLR_MODIFIER_SHIFT) != 0) { switch (sym) { - c.XKB_KEY_Return => { - if (self.root.focused_view) |current_focus| { - const node = @fieldParentPtr(std.TailQueue(View).Node, "data", current_focus); - if (node != self.root.views.first) { - self.root.views.remove(node); - self.root.views.prepend(node); - self.root.arrange(); - } - } - }, c.XKB_KEY_H => { if (self.root.master_count < self.root.views.len) { self.root.master_count += 1; @@ -134,6 +124,13 @@ pub const Server = struct { self.root.arrange(); } }, + 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, } } else { @@ -154,11 +151,14 @@ pub const Server = struct { } }, 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; + if (self.root.focused_view) |current_focus| { + const node = @fieldParentPtr(std.TailQueue(View).Node, "data", current_focus); + if (node != self.root.views.first) { + self.root.views.remove(node); + self.root.views.prepend(node); + self.root.arrange(); + } + } }, else => return false, }