From 0b2e29fa767173f7346a3cce47f0a78ffeef0b8a Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 1 Apr 2025 21:18:15 +0200 Subject: [PATCH] keyboard based resize in hyprland and waybar --- packages/hyprland/keybinds.conf | 29 ++++++++++++++++++++++++++++- packages/nvim/default.nix | 1 + packages/waybar/config | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/hyprland/keybinds.conf b/packages/hyprland/keybinds.conf index 85effbe..f36b4b0 100644 --- a/packages/hyprland/keybinds.conf +++ b/packages/hyprland/keybinds.conf @@ -17,11 +17,16 @@ bind = $mainMod, S, exec, rofi-screenshot, bind = $mainMod, F, fullscreen,1 bind = SUPER_SHIFT, F, fullscreen,0 -# Move focus with mainMod + arrow keys +# Move focus with mainMod + hjkl keys bind = $mainMod, H, movefocus, l bind = $mainMod, L, movefocus, r bind = $mainMod, K, movefocus, u bind = $mainMod, J, movefocus, d +# Move windows with mainMod + hjkl keys +bind = SUPER_SHIFT, H, movewindow, l +bind = SUPER_SHIFT, J, movewindow, d +bind = SUPER_SHIFT, K, movewindow, u +bind = SUPER_SHIFT, L, movewindow, r # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 @@ -55,3 +60,25 @@ bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow + + + +# will switch to a submap called resize +bind = $mainMod, R, submap, resize + +# will start a submap called "resize" +submap = resize + +# sets repeatable binds for resizing the active window +binde = , L, resizeactive, 10 0 +binde = , H, resizeactive, -10 0 +binde = , K, resizeactive, 0 -10 +binde = , J, resizeactive, 0 10 + +# use reset to go back to the global submap +bind = , escape, submap, reset + +# will reset the submap, which will return to the global submap +submap = reset + +# keybinds further down will be global again... diff --git a/packages/nvim/default.nix b/packages/nvim/default.nix index 6cf851a..0cfc6a0 100644 --- a/packages/nvim/default.nix +++ b/packages/nvim/default.nix @@ -6,6 +6,7 @@ nil ripgrep lldb + gcc ]; programs.neovim = { diff --git a/packages/waybar/config b/packages/waybar/config index 7edf4e4..4e1aafa 100644 --- a/packages/waybar/config +++ b/packages/waybar/config @@ -3,7 +3,7 @@ "position": "top", "height": 35, "spacing": 0, - "modules-left": ["clock", "hyprland/workspaces"], + "modules-left": ["clock", "hyprland/workspaces", "hyprland/submap"], "modules-center": [ ], "modules-right": ["network", "cpu", "memory", "custom/keyboard-layout", "pulseaudio", "tray"],