diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-18 13:41:04 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-04-18 13:41:04 +0200 |
| commit | 64a3b72a1cca547eecc52ba33e832c7b1700b31b (patch) | |
| tree | 1e19a3fb9b7e35ca34619b9cc787589fce9165a2 /src/config.zig | |
| parent | e0c6b5bf729be8596c412bf401b8d4cf218cdda6 (diff) | |
| download | river-64a3b72a1cca547eecc52ba33e832c7b1700b31b.tar.gz river-64a3b72a1cca547eecc52ba33e832c7b1700b31b.tar.xz | |
Split up commands into separate files
Diffstat (limited to 'src/config.zig')
| -rw-r--r-- | src/config.zig | 80 |
1 files changed, 66 insertions, 14 deletions
diff --git a/src/config.zig b/src/config.zig index f927aca..01d217d 100644 --- a/src/config.zig +++ b/src/config.zig @@ -36,13 +36,28 @@ pub const Config = struct { const mod = c.WLR_MODIFIER_LOGO; // Mod+Shift+Return to start an instance of alacritty - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_Return, .modifiers = mod | c.WLR_MODIFIER_SHIFT, .command = command.spawn, .arg = .{ .str = "alacritty" } }); + try self.keybinds.append(Keybind{ + .keysym = c.XKB_KEY_Return, + .modifiers = mod | c.WLR_MODIFIER_SHIFT, + .command = command.spawn, + .arg = .{ .str = "alacritty" }, + }); // Mod+Q to close the focused view - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_q, .modifiers = mod, .command = command.close, .arg = .{ .none = {} } }); + try self.keybinds.append(Keybind{ + .keysym = c.XKB_KEY_q, + .modifiers = mod, + .command = command.close_view, + .arg = .{ .none = {} }, + }); // Mod+E to exit river - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_e, .modifiers = mod, .command = command.exitCompositor, .arg = .{ .none = {} } }); + 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( @@ -60,16 +75,43 @@ pub const Config = struct { .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 = {} } }); + // 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 = {} }, + }); // Mod+H and Mod+L to increase/decrease the width of the master column - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_h, .modifiers = mod, .command = command.modifyMasterFactor, .arg = .{ .float = 0.05 } }); - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_l, .modifiers = mod, .command = command.modifyMasterFactor, .arg = .{ .float = -0.05 } }); + try self.keybinds.append(Keybind{ + .keysym = c.XKB_KEY_h, + .modifiers = mod, + .command = command.modifyMasterFactor, + .arg = .{ .float = 0.05 }, + }); + try self.keybinds.append(Keybind{ + .keysym = c.XKB_KEY_l, + .modifiers = mod, + .command = command.modifyMasterFactor, + .arg = .{ .float = -0.05 }, + }); - // Mod+Shift+H and Mod+Shift+L to increment/decrement the number of master views in the layout - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_h, .modifiers = mod | c.WLR_MODIFIER_SHIFT, .command = command.modifyMasterCount, .arg = .{ .int = 1 } }); - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_l, .modifiers = mod | c.WLR_MODIFIER_SHIFT, .command = command.modifyMasterCount, .arg = .{ .int = -1 } }); + // Mod+Shift+H and Mod+Shift+L to increment/decrement the number of + // master views in the layout + try self.keybinds.append(Keybind{ + .keysym = c.XKB_KEY_h, + .modifiers = mod | c.WLR_MODIFIER_SHIFT, + .command = command.modifyMasterCount, + .arg = .{ .int = 1 }, + }); + try self.keybinds.append(Keybind{ + .keysym = c.XKB_KEY_l, + .modifiers = mod | c.WLR_MODIFIER_SHIFT, + .command = command.modifyMasterCount, + .arg = .{ .int = -1 }, + }); comptime var i = 0; inline while (i < 9) : (i += 1) { @@ -84,7 +126,7 @@ pub const Config = struct { try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_1 + i, .modifiers = mod | c.WLR_MODIFIER_SHIFT, - .command = command.setFocusedViewTags, + .command = command.setViewTags, .arg = .{ .uint = 1 << i }, }); // Mod+Ctrl+[1-9] to toggle focus of tag [1-9] @@ -98,16 +140,26 @@ pub const Config = struct { try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_1 + i, .modifiers = mod | c.WLR_MODIFIER_CTRL | c.WLR_MODIFIER_SHIFT, - .command = command.toggleFocusedViewTags, + .command = command.toggleViewTags, .arg = .{ .uint = 1 << i }, }); } // Mod+0 to focus all tags - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_0, .modifiers = mod, .command = command.focusTags, .arg = .{ .uint = 0xFFFFFFFF } }); + try self.keybinds.append(Keybind{ + .keysym = c.XKB_KEY_0, + .modifiers = mod, + .command = command.focusTags, + .arg = .{ .uint = 0xFFFFFFFF }, + }); // Mod+Shift+0 to tag focused view with all tags - try self.keybinds.append(Keybind{ .keysym = c.XKB_KEY_0, .modifiers = mod | c.WLR_MODIFIER_SHIFT, .command = command.setFocusedViewTags, .arg = .{ .uint = 0xFFFFFFFF } }); + try self.keybinds.append(Keybind{ + .keysym = c.XKB_KEY_0, + .modifiers = mod | c.WLR_MODIFIER_SHIFT, + .command = command.setViewTags, + .arg = .{ .uint = 0xFFFFFFFF }, + }); // Mod+Period and Mod+Comma to focus the next/previous output try self.keybinds.append(Keybind{ |
