From f90a73b35d74c606777d37ac46445e423ec23515 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sun, 6 Sep 2026 15:38:47 +0530 Subject: feat(desktop/niri): added and modified keybindings, fixed configs - using keybindings - Mod+D for launching rofi - Mod+R for cycling between layouts (50% and 100%) - fixed Mod+number keybinding for moving to workspaces - removed unnecessary/unused keybindings - using the home-manager option to set the layer-rule for the overview background instead of writing raw text configuration --- modules/desktop/niri/default.nix | 18 +++++++++++------- modules/desktop/niri/keybindings.nix | 36 ++++++++++++------------------------ 2 files changed, 23 insertions(+), 31 deletions(-) (limited to 'modules/desktop/niri') diff --git a/modules/desktop/niri/default.nix b/modules/desktop/niri/default.nix index 1f1533d..b13cdf4 100644 --- a/modules/desktop/niri/default.nix +++ b/modules/desktop/niri/default.nix @@ -65,6 +65,9 @@ }; wayland.windowManager.niri.settings = { + hotkey-overlay = { + skip-at-startup = { }; + }; input = { keyboard.xkb.layout = "us"; touchpad = { @@ -75,6 +78,10 @@ accel-speed = 0.5; }; }; + layer-rule._children = [ + { "match namespace=\"^wallpaper$\"" = { }; } + { place-within-backdrop = true; } + ]; layout = { gaps = 5; struts = { @@ -92,6 +99,10 @@ }; border.off = { }; shadow.off = { }; + preset-column-widths._children = [ + { proportion = 0.5; } + { proportion = 1.0; } + ]; }; prefer-no-csd = true; screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; @@ -104,12 +115,5 @@ "fill" ]; }; - - wayland.windowManager.niri.extraConfig = '' - layer-rule { - match namespace="^wallpaper$" - place-within-backdrop true - } - ''; }; } diff --git a/modules/desktop/niri/keybindings.nix b/modules/desktop/niri/keybindings.nix index d1d15a9..a1ae567 100644 --- a/modules/desktop/niri/keybindings.nix +++ b/modules/desktop/niri/keybindings.nix @@ -7,43 +7,43 @@ let workspaces = [ { key = "1"; - workspace = "1"; + workspace = 1; } { key = "2"; - workspace = "2"; + workspace = 2; } { key = "3"; - workspace = "3"; + workspace = 3; } { key = "4"; - workspace = "4"; + workspace = 4; } { key = "5"; - workspace = "5"; + workspace = 5; } { key = "6"; - workspace = "6"; + workspace = 6; } { key = "7"; - workspace = "7"; + workspace = 7; } { key = "8"; - workspace = "8"; + workspace = 8; } { key = "9"; - workspace = "9"; + workspace = 9; } { key = "0"; - workspace = "10"; + workspace = 10; } ]; @@ -72,7 +72,7 @@ in } // workspaceBinds // (lib.optionalAttrs config.desktop.enable { - "Mod+R" = { + "Mod+D" = { _props.hotkey-overlay-title = "Run an Application: rofi"; spawn = [ (lib.getExe config.desktop.rofi.package) @@ -86,18 +86,6 @@ in _props.hotkey-overlay-title = "Open a Terminal: kitty"; spawn = [ (lib.getExe config.terminal.kitty.package) ]; }; - "Mod+T".spawn = [ (lib.getExe config.terminal.kitty.package) ]; - }) - // (lib.optionalAttrs (config.terminal.kitty.enable && config.file-management.yazi.enable) { - "Mod+F".spawn = [ - (lib.getExe config.terminal.kitty.package) - "--class" - "yazi" - "--title" - "Yazi" - "-e" - (lib.getExe config.file-management.yazi.package) - ]; }) // { # Column-aware directional navigation. @@ -116,11 +104,11 @@ in "Mod+Shift+J".move-column-to-workspace-down = { }; "Mod+Shift+K".move-column-to-workspace-up = { }; - "Mod+D".toggle-window-floating = { }; "Mod+V".toggle-window-floating = { }; "Mod+M".fullscreen-window = { }; "Mod+Equal".set-column-width = [ "+10%" ]; "Mod+Minus".set-column-width = [ "-10%" ]; + "Mod+R".switch-preset-column-width = { }; "Mod+U".focus-workspace-down = { }; "Mod+I".focus-workspace-up = { }; "Mod+Ctrl+U".move-column-to-workspace-down = { }; -- cgit v1.2.3