{ lib, config, ... }: let cfg = config.marleyos.wayland.niri; in { options.marleyos.wayland.niri = { enable = lib.mkEnableOption "niri"; }; config = lib.mkIf cfg.enable { marleyos = { programs = { waybar.enable = true; wlogout.enable = true; fuzzel.enable = true; }; services = { swaybg = { enable = true; wallpaper = ./wallpaper.png; }; swaync.enable = true; }; }; programs.niri = { # Auto-enabled by the nixos module # enable = true; settings = let cmd = command: {command = [command];}; in { prefer-no-csd = true; hotkey-overlay.skip-at-startup = true; layout = { gaps = 16; center-focused-column = "never"; preset-column-widths = [ {proportion = 0.33333;} {proportion = 0.5;} {proportion = 0.66667;} ]; default-column-width = {proportion = 0.5;}; focus-ring = { width = 4; active = {color = "#7fc8ff";}; inactive = {color = "#505050";}; }; border = { width = 4; active = {color = "#ffc87f";}; inactive = {color = "#505050";}; }; shadow = { softness = 30; spread = 5; offset = { x = 0; y = 5; }; color = "#0007"; }; }; screenshot-path = "~/pictures/screenshots/%Y-%m-%d %H-%M-%S.png"; window-rules = [ { matches = [{app-id = "^org\.wezfurlong\.wezterm$";}]; default-column-width = {}; } { matches = [ { app-id = "firefox$"; title = "^Picture-in-Picture$"; } ]; open-floating = true; } ]; binds = with config.lib.niri.actions; { "Mod+Shift+Slash".action = show-hotkey-overlay; "Mod+Return".action = spawn (lib.getExe config.marleyos.apps.terminal); "Mod+R".action = spawn (lib.getExe config.programs.fuzzel.package); "Mod+Q".action = close-window; "Mod+H".action = focus-column-left; "Mod+J".action = focus-window-down; "Mod+K".action = focus-window-up; "Mod+L".action = focus-column-right; "Mod+Shift+H".action = move-column-left; "Mod+Shift+J".action = move-window-down; "Mod+Shift+K".action = move-window-up; "Mod+Shift+L".action = move-column-right; "Mod+Home".action = focus-column-first; "Mod+End".action = focus-column-last; "Mod+Shift+Home".action = move-column-to-first; "Mod+Shift+End".action = move-column-to-last; "Mod+Shift+Ctrl+H".action = move-column-to-monitor-left; "Mod+Shift+Ctrl+J".action = move-column-to-monitor-down; "Mod+Shift+Ctrl+K".action = move-column-to-monitor-up; "Mod+Shift+Ctrl+L".action = move-column-to-monitor-right; "Mod+Page_Down".action = focus-workspace-down; "Mod+Page_Up".action = focus-workspace-up; "Mod+Shift+Page_Down".action = move-column-to-workspace-down; "Mod+Shift+Page_Up".action = move-column-to-workspace-up; "Mod+Ctrl+Page_Down".action = move-workspace-up; "Mod+Ctrl+Page_Up".action = move-workspace-down; "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; "Mod+P".action = switch-preset-column-width; "Mod+Shift+P".action = switch-preset-window-height; "Mod+Ctrl+P".action = reset-window-height; "Mod+F".action = maximize-column; "Mod+Shift+F".action = fullscreen-window; "Mod+Ctrl+F".action = expand-column-to-available-width; "Mod+C".action = center-column; "Mod+Minus".action = set-column-width "-10%"; "Mod+Equal".action = set-column-width "+10%"; "Mod+Shift+Minus".action = set-window-height "-10%"; "Mod+Shift+Equal".action = set-window-height "+10%"; "Mod+G".action = toggle-window-floating; "Mod+Shift+G".action = switch-focus-between-floating-and-tiling; "Mod+T".action = toggle-column-tabbed-display; "Print".action = screenshot; "Ctrl+Print".action = screenshot-screen; "Alt+Print".action = screenshot-window; "Mod+Escape".action = toggle-keyboard-shortcuts-inhibit; "Mod+Shift+E".action = quit; "Ctrl+Alt+Delete".action = quit; }; }; }; }; }