aboutsummaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-04-18 13:12:15 +0200
committerIsaac Freund <ifreund@ifreund.xyz>2020-04-18 13:12:15 +0200
commite0c6b5bf729be8596c412bf401b8d4cf218cdda6 (patch)
treeaa72977fbe8902c26fb8bc7b26e8c2c66606fafc /src/config.zig
parent6914f32ce362e450c1d16dbb610d5e0b176ee040 (diff)
downloadriver-e0c6b5bf729be8596c412bf401b8d4cf218cdda6.tar.gz
river-e0c6b5bf729be8596c412bf401b8d4cf218cdda6.tar.xz
Refactor focus next/prev view/output commands
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/config.zig b/src/config.zig
index b7be734..f927aca 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -45,8 +45,20 @@ pub const Config = struct {
try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_e, .modifiers = mod, .command = command.exitCompositor, .arg = .{ .none = {} } });
// Mod+J and Mod+K to focus the next/previous view in the layout stack
- try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_j, .modifiers = mod, .command = command.focusNextView, .arg = .{ .none = {} } });
- try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_k, .modifiers = mod, .command = command.focusPrevView, .arg = .{ .none = {} } });
+ try self.keybinds.append(
+ Keybind{
+ .keysym = c.XKB_KEY_j,
+ .modifiers = mod,
+ .command = command.focusView,
+ .arg = .{ .direction = .Next },
+ },
+ );
+ try self.keybinds.append(Keybind{
+ .keysym = c.XKB_KEY_k,
+ .modifiers = mod,
+ .command = command.focusView,
+ .arg = .{ .direction = .Prev },
+ });
// Mod+Return to bump the focused view to the top of the layout stack, making it the new master
try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_Return, .modifiers = mod, .command = command.zoom, .arg = .{ .none = {} } });
@@ -98,7 +110,17 @@ pub const Config = struct {
try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_0, .modifiers = mod | c.WLR_MODIFIER_SHIFT, .command = command.setFocusedViewTags, .arg = .{ .uint = 0xFFFFFFFF } });
// Mod+Period and Mod+Comma to focus the next/previous output
- try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_period, .modifiers = mod, .command = command.focusNextOutput, .arg = .{ .none = {} } });
- try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_comma, .modifiers = mod, .command = command.focusPrevOutput, .arg = .{ .none = {} } });
+ try self.keybinds.append(Keybind{
+ .keysym = c.XKB_KEY_period,
+ .modifiers = mod,
+ .command = command.focusOutput,
+ .arg = .{ .direction = .Next },
+ });
+ try self.keybinds.append(Keybind{
+ .keysym = c.XKB_KEY_comma,
+ .modifiers = mod,
+ .command = command.focusOutput,
+ .arg = .{ .direction = .Prev },
+ });
}
};