From ae21713f260fc1599c36c0e4cf572d24b0379ef4 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sun, 26 Jul 2026 18:21:26 +0530 Subject: feat: hyprland keybindings, neomutt refactoring - Fixed the keybinding to resize the windows to 50% and 100% (Super + =) - Left Click + Drag on mouse to move windows - Right Click + Drag on mouse to resize --- modules/desktop/hyprland/default.nix | 13 ------------- modules/desktop/hyprland/keybindings.nix | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 15 deletions(-) (limited to 'modules/desktop/hyprland') diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix index 09f2639..c1e3053 100644 --- a/modules/desktop/hyprland/default.nix +++ b/modules/desktop/hyprland/default.nix @@ -145,19 +145,6 @@ in preserve_split = true; }; }; - - window_rule = [ - { - name = "float-file-explorer"; - match.class = "^(file-explorer)$"; - float = true; - } - { - name = "center-file-explorer"; - match.class = "^(file-explorer)$"; - center = true; - } - ]; }; }; diff --git a/modules/desktop/hyprland/keybindings.nix b/modules/desktop/hyprland/keybindings.nix index f5c98b5..1ac1d9a 100644 --- a/modules/desktop/hyprland/keybindings.nix +++ b/modules/desktop/hyprland/keybindings.nix @@ -21,12 +21,23 @@ let ]; }; + bindMouse = key: dispatcher: { + _args = [ + (lua "mainMod .. \" + ${key}\"") + (lua dispatcher) + { mouse = true; } + ]; + }; + execLua = cmd: "hl.dsp.exec_cmd(\"${cmd}\")"; execLuaSingle = cmd: "hl.dsp.exec_cmd('${cmd}')"; in { config.wayland.windowManager.hyprland.settings.bind = lib.flatten [ + (bindMouse "mouse:272" "hl.dsp.window.drag()") # mainMod + LMB drag: move + (bindMouse "mouse:273" "hl.dsp.window.resize()") # mainMod + RMB drag: resize + (lib.optionals config.desktop.rofi.enable [ (bind "R" (execLua "${lib.getExe config.desktop.rofi.package} -show drun")) ]) @@ -35,11 +46,11 @@ in ]) (lib.optionals (config.terminal.kitty.enable && config.file-management.yazi.enable) [ (bind "F" ( - execLua "${lib.getExe config.terminal.kitty.package} --class file-explorer --title 'Yazi' -e ${lib.getExe config.file-management.yazi.package}" + execLua "${lib.getExe config.terminal.kitty.package} --class yazi --title 'Yazi' -e ${lib.getExe config.file-management.yazi.package}" )) ]) (bind "SHIFT + Q" "hl.dsp.window.close()") - (bind "Equal" (execLua "layoutmsg colresize +conf")) + (bind "Equal" "hl.dsp.layout(\"colresize +conf\")") (lib.optionals config.system.brightnessctl.enable [ (bindRawFlags "XF86MonBrightnessDown" -- cgit v1.2.3