Swap bindngs for send to top and start terminal

This commit is contained in:
Isaac Freund 2020-03-29 14:07:39 +02:00
parent a2901c90ba
commit e55d40ab10
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

@ -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,
}