From 5bc37c7009f8f8361cdd77e8d6e4f335b0776388 Mon Sep 17 00:00:00 2001 From: Jelle Spreeuwenberg Date: Wed, 29 Apr 2026 15:49:32 +0200 Subject: [PATCH] refactor: niri config --- modules/capabilities/niri/_bindings.nix | 136 ++++++---- modules/capabilities/niri/_shortcuts.nix | 225 ++++++++++++++++ modules/capabilities/niri/default.nix | 322 +++++------------------ 3 files changed, 376 insertions(+), 307 deletions(-) create mode 100644 modules/capabilities/niri/_shortcuts.nix diff --git a/modules/capabilities/niri/_bindings.nix b/modules/capabilities/niri/_bindings.nix index 6be4230..5282306 100644 --- a/modules/capabilities/niri/_bindings.nix +++ b/modules/capabilities/niri/_bindings.nix @@ -1,9 +1,10 @@ { browserCommand, + shortcutCommands, terminalCommand, - uxCommands, }: { + # Application and utility launchers "Mod+Return" = { action.spawn = terminalCommand; hotkey-overlay.title = "Terminal"; @@ -22,25 +23,76 @@ }; "Mod+E" = { repeat = false; - action.spawn = uxCommands.neovimProjects; + action.spawn = shortcutCommands.neovimProjects; hotkey-overlay.title = "Neovim Projects"; }; "Mod+Ctrl+Return" = { repeat = false; - action.spawn = uxCommands.nixosTerminal; + action.spawn = shortcutCommands.nixosTerminal; hotkey-overlay.title = "NixOS Config Terminal"; }; "Mod+Ctrl+Shift+Return" = { repeat = false; - action.spawn = uxCommands.nixosSwitch; + action.spawn = shortcutCommands.nixosSwitch; hotkey-overlay.title = "NixOS Switch"; }; "Mod+Ctrl+E" = { repeat = false; - action.spawn = uxCommands.editSecrets; + action.spawn = shortcutCommands.editSecrets; hotkey-overlay.title = "Edit Secrets"; }; + "Mod+Ctrl+F" = { + repeat = false; + action.spawn = [ + shortcutCommands.vicinaeCommand + "files" + ]; + hotkey-overlay.title = "Find Files"; + }; + "Mod+V" = { + repeat = false; + action.spawn = shortcutCommands.clipboardHistory; + hotkey-overlay.title = "Clipboard History"; + }; + "Mod+Ctrl+N" = { + repeat = false; + action.spawn = [ + shortcutCommands.vicinaeCommand + "nix-options" + ]; + hotkey-overlay.title = "NixOS Options"; + }; + "Mod+Ctrl+H" = { + repeat = false; + action.spawn = [ + shortcutCommands.vicinaeCommand + "home-manager-options" + ]; + hotkey-overlay.title = "Home Manager Options"; + }; + "Mod+Ctrl+P" = { + repeat = false; + action.spawn = [ + shortcutCommands.vicinaeCommand + "nix-packages" + ]; + hotkey-overlay.title = "Nix Packages"; + }; + "Mod+Ctrl+W" = { + repeat = false; + action.spawn = [ + shortcutCommands.vicinaeCommand + "niri-windows" + ]; + hotkey-overlay.title = "Windows"; + }; + "Mod+Ctrl+C" = { + repeat = false; + action.spawn = shortcutCommands.pickColor; + hotkey-overlay.title = "Pick Color"; + }; + # Hardware media, volume, and brightness keys "XF86AudioPlay" = { action.spawn-sh = "playerctl play-pause"; allow-when-locked = true; @@ -82,10 +134,12 @@ allow-when-locked = true; }; + # Screenshots "Mod+S".action.screenshot = [ ]; "Mod+Ctrl+S".action.screenshot-screen = [ ]; "Mod+Alt+S".action.screenshot-window = [ ]; + # Session and compositor controls "Mod+Shift+Slash".action.show-hotkey-overlay = [ ]; "Mod+Escape" = { action.toggle-keyboard-shortcuts-inhibit = [ ]; @@ -99,6 +153,7 @@ "Ctrl+Alt+Delete".action.quit = [ ]; "Mod+Shift+P".action.power-off-monitors = [ ]; + # Overview and window close "Mod+O" = { action.toggle-overview = [ ]; repeat = false; @@ -108,6 +163,7 @@ repeat = false; }; + # Keyboard focus movement "Mod+Left".action.focus-column-or-monitor-left = [ ]; "Mod+Down".action.focus-window-down = [ ]; "Mod+Up".action.focus-window-up = [ ]; @@ -117,6 +173,7 @@ "Mod+K".action.focus-window-up = [ ]; "Mod+L".action.focus-column-or-monitor-right = [ ]; + # Keyboard window and column movement "Mod+Alt+Left".action.move-column-left-or-to-monitor-left = [ ]; "Mod+Alt+Down".action.move-window-down-or-to-workspace-down = [ ]; "Mod+Alt+Up".action.move-window-up-or-to-workspace-up = [ ]; @@ -126,12 +183,19 @@ "Mod+Alt+K".action.move-window-up-or-to-workspace-up = [ ]; "Mod+Alt+L".action.move-column-right-or-to-monitor-right = [ ]; + # First and last column navigation "Mod+Home".action.focus-column-first = [ ]; "Mod+End".action.focus-column-last = [ ]; "Mod+Alt+Home".action.move-column-to-first = [ ]; "Mod+Alt+End".action.move-column-to-last = [ ]; + # Move focus, columns, and workspaces across monitors "Mod+Tab".action.focus-monitor-next = [ ]; + "Mod+A" = { + repeat = false; + action.spawn = shortcutCommands.swapMonitorWorkspaces; + hotkey-overlay.title = "Swap Monitor Workspaces"; + }; "Mod+Alt+Tab".action.move-column-to-monitor-next = [ ]; "Mod+Shift+Tab".action.move-workspace-to-monitor-next = [ ]; @@ -140,21 +204,25 @@ "Mod+Shift+Up".action.focus-monitor-up = [ ]; "Mod+Shift+Right".action.focus-monitor-right = [ ]; + # Linear workspace navigation "Mod+Page_Down".action.focus-workspace-down = [ ]; "Mod+Page_Up".action.focus-workspace-up = [ ]; "Mod+U".action.focus-workspace-down = [ ]; "Mod+I".action.focus-workspace-up = [ ]; + # Move columns between adjacent workspaces "Mod+Alt+Page_Down".action.move-column-to-workspace-down = [ ]; "Mod+Alt+Page_Up".action.move-column-to-workspace-up = [ ]; "Mod+Alt+U".action.move-column-to-workspace-down = [ ]; "Mod+Alt+I".action.move-column-to-workspace-up = [ ]; + # Reorder workspaces "Mod+Shift+Page_Down".action.move-workspace-down = [ ]; "Mod+Shift+Page_Up".action.move-workspace-up = [ ]; "Mod+Shift+U".action.move-workspace-down = [ ]; "Mod+Shift+I".action.move-workspace-up = [ ]; + # Mouse workspace navigation "Mod+WheelScrollDown" = { action.focus-workspace-down = [ ]; cooldown-ms = 150; @@ -172,6 +240,7 @@ cooldown-ms = 150; }; + # Mouse column navigation and movement "Mod+WheelScrollRight".action.focus-column-or-monitor-right = [ ]; "Mod+WheelScrollLeft".action.focus-column-or-monitor-left = [ ]; "Mod+Alt+WheelScrollRight".action.move-column-right-or-to-monitor-right = [ ]; @@ -179,6 +248,7 @@ "Mod+Shift+WheelScrollDown".action.focus-column-or-monitor-right = [ ]; "Mod+Shift+WheelScrollUp".action.focus-column-or-monitor-left = [ ]; + # Direct workspace focus "Mod+1".action.focus-workspace = 1; "Mod+2".action.focus-workspace = 2; "Mod+3".action.focus-workspace = 3; @@ -189,6 +259,7 @@ "Mod+8".action.focus-workspace = 8; "Mod+9".action.focus-workspace = 9; + # Move columns to numbered workspaces "Mod+Ctrl+1".action.move-column-to-workspace = 1; "Mod+Ctrl+2".action.move-column-to-workspace = 2; "Mod+Ctrl+3".action.move-column-to-workspace = 3; @@ -199,11 +270,13 @@ "Mod+Ctrl+8".action.move-column-to-workspace = 8; "Mod+Ctrl+9".action.move-column-to-workspace = 9; + # Add and remove windows from columns "Mod+BracketLeft".action.consume-or-expel-window-left = [ ]; "Mod+BracketRight".action.consume-or-expel-window-right = [ ]; "Mod+Comma".action.consume-window-into-column = [ ]; "Mod+Period".action.expel-window-from-column = [ ]; + # Column and window presentation modes "Mod+R".action.switch-preset-column-width = [ ]; "Mod+Shift+R".action.switch-preset-column-width-back = [ ]; "Mod+Ctrl+R".action.reset-window-height = [ ]; @@ -213,6 +286,7 @@ "Mod+M".action.maximize-window-to-edges = [ ]; "Mod+C".action.center-column = [ ]; + # Manual column width and window height adjustments "Mod+Shift+H".action.set-column-width = "-10%"; "Mod+Shift+L".action.set-column-width = "+10%"; "Mod+Shift+J".action.set-window-height = "+10%"; @@ -222,57 +296,7 @@ "Mod+Shift+Minus".action.set-window-height = "-10%"; "Mod+Shift+Equal".action.set-window-height = "+10%"; - "Mod+Ctrl+F" = { - repeat = false; - action.spawn = [ - uxCommands.vicinaeCommand - "files" - ]; - hotkey-overlay.title = "Find Files"; - }; - "Mod+V" = { - repeat = false; - action.spawn = uxCommands.clipboardHistory; - hotkey-overlay.title = "Clipboard History"; - }; - "Mod+Ctrl+N" = { - repeat = false; - action.spawn = [ - uxCommands.vicinaeCommand - "nix-options" - ]; - hotkey-overlay.title = "NixOS Options"; - }; - "Mod+Ctrl+H" = { - repeat = false; - action.spawn = [ - uxCommands.vicinaeCommand - "home-manager-options" - ]; - hotkey-overlay.title = "Home Manager Options"; - }; - "Mod+Ctrl+P" = { - repeat = false; - action.spawn = [ - uxCommands.vicinaeCommand - "nix-packages" - ]; - hotkey-overlay.title = "Nix Packages"; - }; - "Mod+Ctrl+W" = { - repeat = false; - action.spawn = [ - uxCommands.vicinaeCommand - "niri-windows" - ]; - hotkey-overlay.title = "Windows"; - }; - "Mod+Ctrl+C" = { - repeat = false; - action.spawn = uxCommands.pickColor; - hotkey-overlay.title = "Pick Color"; - }; - + # Floating and tabbed layout toggles "Mod+Alt+V".action.toggle-window-floating = [ ]; "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = [ ]; "Mod+W".action.toggle-column-tabbed-display = [ ]; diff --git a/modules/capabilities/niri/_shortcuts.nix b/modules/capabilities/niri/_shortcuts.nix new file mode 100644 index 0000000..693720a --- /dev/null +++ b/modules/capabilities/niri/_shortcuts.nix @@ -0,0 +1,225 @@ +{ + config, + lib, + pkgs, + repo, +}: +let + nixosConfigDir = repo.account.nixosConfigurationPath; + mkTerminalScript = + { + name, + title, + appId ? "niri-shortcut-terminal", + workdir ? nixosConfigDir, + command ? null, + runtimeInputs ? [ ], + }: + let + args = + ( + if config.meta.desktop.terminal.desktopEntryName == "kitty" then + [ + "--class" + appId + "--title" + title + "--directory" + workdir + ] + else if config.meta.desktop.terminal.desktopEntryName == "foot" then + [ + "--app-id" + appId + "--title" + title + "--working-directory" + workdir + ] + else + [ ] + ) + ++ lib.optionals (command != null) [ + "--" + "${pkgs.bash}/bin/bash" + "-lc" + command + ]; + in + pkgs.writeShellApplication { + inherit name runtimeInputs; + checkPhase = ""; + text = '' + # shellcheck disable=SC2016 + cd ${lib.escapeShellArg workdir} + exec ${lib.escapeShellArg config.meta.desktop.terminal.command} ${ + lib.concatMapStringsSep " " lib.escapeShellArg args + } + ''; + }; +in +rec { + scripts = { + nixosTerminal = mkTerminalScript { + name = "niri-shortcut-nixos-terminal"; + title = "NixOS Config"; + }; + + nixosSwitch = mkTerminalScript { + name = "niri-shortcut-nixos-switch"; + title = "NixOS Switch"; + appId = "niri-shortcut-float"; + runtimeInputs = [ + pkgs.coreutils + pkgs.nh + ]; + command = '' + set -o pipefail + + log_dir="''${XDG_STATE_HOME:-$HOME/.local/state}/nixos-switch" + mkdir -p "$log_dir" + log="$log_dir/$(date +%Y%m%d-%H%M%S).log" + status_file="$(mktemp)" + + printf 'Running nh os switch in %s\n\n' ${lib.escapeShellArg nixosConfigDir} + ( + cd ${lib.escapeShellArg nixosConfigDir} + nh os switch + printf '%s' "$?" > "$status_file" + ) 2>&1 | tee "$log" + + status="$(cat "$status_file")" + rm -f "$status_file" + + printf '\nLog: %s\n' "$log" + if [ "$status" -eq 0 ]; then + printf 'NixOS switch completed successfully.\n' + else + printf 'NixOS switch failed with exit code %s.\n' "$status" + fi + + printf 'Press Enter to close...' + read -r _ + exit "$status" + ''; + }; + + editSecrets = mkTerminalScript { + name = "niri-shortcut-edit-secrets"; + title = "Edit Secrets"; + appId = "niri-shortcut-float"; + runtimeInputs = [ pkgs.sops ]; + command = '' + sops edit ${lib.escapeShellArg "${nixosConfigDir}/modules/secrets/secrets.yaml"} + ''; + }; + + neovimProjects = mkTerminalScript { + name = "niri-shortcut-neovim-projects"; + title = "Neovim Projects"; + command = '' + nvim -c 'Telescope projects' + ''; + }; + + vicinaeCommand = pkgs.writeShellApplication { + name = "niri-shortcut-vicinae-command"; + runtimeInputs = [ config.programs.vicinae.package ]; + text = '' + case "''${1:-}" in + files) + link="vicinae://extensions/sameoldlab/fuzzy-files/find" + ;; + nix-options) + link="vicinae://extensions/knoopx/nix/options" + ;; + home-manager-options) + link="vicinae://extensions/knoopx/nix/home-manager-options" + ;; + nix-packages) + link="vicinae://extensions/knoopx/nix/packages" + ;; + niri-windows) + link="vicinae://extensions/knoopx/niri/windows" + ;; + *) + printf 'unknown Vicinae command target: %s\n' "''${1:-}" >&2 + exit 64 + ;; + esac + + exec vicinae deeplink "$link" + ''; + }; + + clipboardHistory = pkgs.writeShellApplication { + name = "niri-shortcut-clipboard-history"; + runtimeInputs = [ + pkgs.cliphist + config.programs.vicinae.package + pkgs.wl-clipboard + ]; + text = '' + selection="$(cliphist list | vicinae dmenu --navigation-title Clipboard --placeholder 'Search clipboard' --no-metadata)" + if [ -z "$selection" ]; then + exit 0 + fi + + printf '%s' "$selection" | cliphist decode | wl-copy + ''; + }; + + pickColor = pkgs.writeShellApplication { + name = "niri-shortcut-pick-color"; + runtimeInputs = [ + pkgs.libnotify + pkgs.niri + pkgs.wl-clipboard + ]; + text = '' + color="$(niri msg pick-color)" + printf '%s' "$color" | wl-copy + notify-send 'Color picked' "$color" + ''; + }; + + swapMonitorWorkspaces = pkgs.writeShellApplication { + name = "niri-shortcut-swap-monitor-workspaces"; + runtimeInputs = [ + pkgs.jq + pkgs.niri + ]; + text = '' + focused_output="$(niri msg --json focused-output | jq -r '.name // empty')" + if [ -z "$focused_output" ]; then + exit 0 + fi + + niri msg action focus-monitor-next + + target_output="$(niri msg --json focused-output | jq -r '.name // empty')" + if [ -z "$target_output" ] || [ "$target_output" = "$focused_output" ]; then + exit 0 + fi + + target_workspace_idx="$( + niri msg --json workspaces \ + | jq -r --arg output "$target_output" ' + first(.[] | select(.output == $output and .is_active) | .idx) // empty + ' + )" + if [ -z "$target_workspace_idx" ]; then + niri msg action focus-monitor "$focused_output" + exit 0 + fi + + niri msg action focus-monitor "$focused_output" + niri msg action move-workspace-to-monitor "$target_output" + niri msg action focus-workspace "$target_workspace_idx" + niri msg action move-workspace-to-monitor "$focused_output" + ''; + }; + }; + + commands = lib.mapAttrs (_: lib.getExe) scripts; +} diff --git a/modules/capabilities/niri/default.nix b/modules/capabilities/niri/default.nix index f70b37b..d24ed84 100644 --- a/modules/capabilities/niri/default.nix +++ b/modules/capabilities/niri/default.nix @@ -11,14 +11,22 @@ in { pkgs, ... }: { imports = [ inputs.niri.nixosModules.niri ]; + nixpkgs.overlays = [ inputs.niri.overlays.niri ]; - programs.niri.enable = true; - programs.niri.package = pkgs.niri-unstable; - programs.dconf.enable = true; + programs = { + dconf.enable = true; + niri = { + enable = true; + package = pkgs.niri-unstable; + }; + }; + + services = { + gvfs.enable = true; + udisks2.enable = true; + }; - services.gvfs.enable = true; - services.udisks2.enable = true; xdg.portal.enable = true; }; @@ -31,241 +39,59 @@ in ... }: let - repoTheme = repo.theme.kanagawa; - browserCommand = config.meta.desktop.browser.command; - fileManagerPackage = config.meta.desktop.fileManager.package; - terminalCommand = config.meta.desktop.terminal.command; - terminalDesktopEntryName = config.meta.desktop.terminal.desktopEntryName; - nixosConfigDir = repo.account.nixosConfigurationPath; - secretsFile = "${nixosConfigDir}/modules/secrets/secrets.yaml"; - outputs = lib.mapAttrs ( - _: display: - { - position = { - x = display.x; - y = display.y; - }; - } - // lib.optionalAttrs (display.primary or false) { - "focus-at-startup" = true; - } - // lib.optionalAttrs (display.scale != null) { - inherit (display) scale; - } - // lib.optionalAttrs (display.width != null && display.height != null && display.refresh != null) { - mode = { - inherit (display) - width - height - refresh - ; - }; - } - ) osConfig.meta.machine.displays; - terminalCommandArg = lib.escapeShellArg terminalCommand; - mkTerminalScript = - { - name, - title, - appId ? "niri-ux-terminal", - workdir ? nixosConfigDir, - command ? null, - runtimeInputs ? [ ], - }: - let - terminalArgs = - if terminalDesktopEntryName == "kitty" then - [ - "--class" - appId - "--title" - title - "--directory" - workdir - ] - else if terminalDesktopEntryName == "foot" then - [ - "--app-id" - appId - "--title" - title - "--working-directory" - workdir - ] - else - [ ]; - commandArgs = - if command == null then - [ ] - else - [ - "--" - "${pkgs.bash}/bin/bash" - "-lc" - command - ]; - execArgs = lib.concatMapStringsSep " " lib.escapeShellArg (terminalArgs ++ commandArgs); - in - pkgs.writeShellApplication { - inherit name runtimeInputs; - checkPhase = ""; - text = '' - # shellcheck disable=SC2016 - cd ${lib.escapeShellArg workdir} - exec ${terminalCommandArg} ${execArgs} - ''; - }; - uxScripts = - let - vicinaePackage = config.programs.vicinae.package or pkgs.vicinae; - in - { - nixosTerminal = mkTerminalScript { - name = "niri-ux-nixos-terminal"; - title = "NixOS Config"; - }; - - nixosSwitch = mkTerminalScript { - name = "niri-ux-nixos-switch"; - title = "NixOS Switch"; - appId = "niri-ux-float"; - runtimeInputs = [ - pkgs.coreutils - pkgs.nh - ]; - command = '' - set -o pipefail - - log_dir="''${XDG_STATE_HOME:-$HOME/.local/state}/nixos-switch" - mkdir -p "$log_dir" - log="$log_dir/$(date +%Y%m%d-%H%M%S).log" - status_file="$(mktemp)" - - printf 'Running nh os switch in %s\n\n' ${lib.escapeShellArg nixosConfigDir} - ( - cd ${lib.escapeShellArg nixosConfigDir} - nh os switch - printf '%s' "$?" > "$status_file" - ) 2>&1 | tee "$log" - - status="$(cat "$status_file")" - rm -f "$status_file" - - printf '\nLog: %s\n' "$log" - if [ "$status" -eq 0 ]; then - printf 'NixOS switch completed successfully.\n' - else - printf 'NixOS switch failed with exit code %s.\n' "$status" - fi - - printf 'Press Enter to close...' - read -r _ - exit "$status" - ''; - }; - - editSecrets = mkTerminalScript { - name = "niri-ux-edit-secrets"; - title = "Edit Secrets"; - appId = "niri-ux-float"; - runtimeInputs = [ pkgs.sops ]; - command = '' - sops edit ${lib.escapeShellArg secretsFile} - ''; - }; - - neovimProjects = mkTerminalScript { - name = "niri-ux-neovim-projects"; - title = "Neovim Projects"; - command = '' - nvim -c 'Telescope projects' - ''; - }; - - vicinaeCommand = pkgs.writeShellApplication { - name = "niri-ux-vicinae-command"; - runtimeInputs = [ vicinaePackage ]; - text = '' - case "''${1:-}" in - files) - link="vicinae://extensions/sameoldlab/fuzzy-files/find" - ;; - nix-options) - link="vicinae://extensions/knoopx/nix/options" - ;; - home-manager-options) - link="vicinae://extensions/knoopx/nix/home-manager-options" - ;; - nix-packages) - link="vicinae://extensions/knoopx/nix/packages" - ;; - niri-windows) - link="vicinae://extensions/knoopx/niri/windows" - ;; - *) - printf 'unknown Vicinae command target: %s\n' "''${1:-}" >&2 - exit 64 - ;; - esac - - exec vicinae deeplink "$link" - ''; - }; - - clipboardHistory = pkgs.writeShellApplication { - name = "niri-ux-clipboard-history"; - runtimeInputs = [ - pkgs.cliphist - vicinaePackage - pkgs.wl-clipboard - ]; - text = '' - selection="$(cliphist list | vicinae dmenu --navigation-title Clipboard --placeholder 'Search clipboard' --no-metadata)" - if [ -z "$selection" ]; then - exit 0 - fi - - printf '%s' "$selection" | cliphist decode | wl-copy - ''; - }; - - pickColor = pkgs.writeShellApplication { - name = "niri-ux-pick-color"; - runtimeInputs = [ - pkgs.libnotify - pkgs.niri - pkgs.wl-clipboard - ]; - text = '' - color="$(niri msg pick-color)" - printf '%s' "$color" | wl-copy - notify-send 'Color picked' "$color" - ''; - }; - }; - uxCommands = lib.mapAttrs (_: lib.getExe) uxScripts; + borderPalette = repo.theme.kanagawa.palette.niri.border; + shortcuts = import ./_shortcuts.nix { + inherit + config + lib + pkgs + repo + ; + }; in { - home.sessionVariables.NIXOS_OZONE_WL = "1"; - - dconf.settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - }; + home = { + sessionVariables.NIXOS_OZONE_WL = "1"; + packages = + with pkgs; + [ + playerctl + brightnessctl + xwayland-satellite + ] + ++ [ + config.meta.desktop.fileManager.package + ] + ++ lib.attrValues shortcuts.scripts; }; - home.packages = - with pkgs; - [ - playerctl - brightnessctl - xwayland-satellite - ] - ++ [ fileManagerPackage ] - ++ lib.attrValues uxScripts; + dconf.settings."org/gnome/desktop/interface".color-scheme = "prefer-dark"; programs.niri.settings = { - inherit outputs; + outputs = lib.mapAttrs ( + _: display: + { + position = { + inherit (display) x y; + }; + } + // lib.optionalAttrs (display.primary or false) { + "focus-at-startup" = true; + } + // lib.optionalAttrs (display.scale != null) { + inherit (display) scale; + } + // lib.optionalAttrs (display.width != null && display.height != null && display.refresh != null) { + mode = { + inherit (display) + width + height + refresh + ; + }; + } + ) osConfig.meta.machine.displays; + environment.DISPLAY = ":0"; spawn-at-startup = [ { command = [ "xwayland-satellite" ]; } @@ -277,9 +103,9 @@ in animations.slowdown = 0.6; - cursor = with config.home.pointerCursor; { - size = size; - theme = name; + cursor = { + inherit (config.home.pointerCursor) size; + theme = config.home.pointerCursor.name; hide-after-inactive-ms = 3000; hide-when-typing = true; }; @@ -288,15 +114,14 @@ in always-center-single-column = true; gaps = 14; focus-ring.enable = false; - default-column-width.proportion = 1. / 2.; border = { enable = true; width = 3; - active.color = repoTheme.palette.niri.border.active; - inactive.color = repoTheme.palette.niri.border.inactive; - urgent.color = repoTheme.palette.niri.border.urgent; + active.color = borderPalette.active; + inactive.color = borderPalette.inactive; + urgent.color = borderPalette.urgent; }; }; @@ -316,7 +141,7 @@ in } { matches = [ - { app-id = "^niri-ux-float$"; } + { app-id = "^niri-shortcut-float$"; } ]; open-floating = true; open-focused = true; @@ -334,18 +159,13 @@ in repeat-rate = 50; xkb.options = "caps:escape"; }; - - touchpad = { - dwt = true; - }; + touchpad.dwt = true; }; binds = import ./_bindings.nix { - inherit - browserCommand - terminalCommand - uxCommands - ; + browserCommand = config.meta.desktop.browser.command; + terminalCommand = config.meta.desktop.terminal.command; + shortcutCommands = shortcuts.commands; }; }; };