diff --git a/homes/x86_64-linux/marley@nyx/default.nix b/homes/x86_64-linux/marley@nyx/default.nix index dd4ff87..ae4cc0d 100644 --- a/homes/x86_64-linux/marley@nyx/default.nix +++ b/homes/x86_64-linux/marley@nyx/default.nix @@ -4,16 +4,10 @@ in { marleyos = { bundles.desktop = enabled; - # wayland.hyprland = { - # enable = true; - # monitors = { - # "DP-1" = "desc:Apple Computer Inc LED Cinema 2A91946Z0K0, 1920x1200, 0x0, 1"; - # "HDMI-A-1" = "desc:Lenovo Group Limited LT2252p Wide 6V8ACF74, 1680x1050, 1920x0, 1"; - # }; - # mainMonitor = "DP-1"; - # }; - - wayland.niri = enabled; + wayland.niri = { + enable = true; + monitors = ["DP-1" "HDMI-A-1"]; + }; }; home.stateVersion = "24.05"; diff --git a/modules/home/wayland/niri/default.nix b/modules/home/wayland/niri/default.nix index ede665a..aa80962 100644 --- a/modules/home/wayland/niri/default.nix +++ b/modules/home/wayland/niri/default.nix @@ -7,6 +7,12 @@ in { options.marleyos.wayland.niri = { enable = lib.mkEnableOption "niri"; + + monitors = lib.mkOption { + type = with lib.types; nullOr (listOf str); + default = null; + description = "The monitors to configure"; + }; }; config = lib.mkIf cfg.enable { @@ -37,6 +43,13 @@ in { prefer-no-csd = true; hotkey-overlay.skip-at-startup = true; + spawn-at-startup = let + inherit (config.marleyos) apps; + in [ + {command = ["sh" "-c" "${lib.getExe apps.terminal} -e tmux new -s main -A"];} + (cmd (lib.getExe apps.browser)) + ]; + layout = { gaps = 16; center-focused-column = "never"; @@ -76,21 +89,36 @@ in { 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; - } - ]; + window-rules = + [ + { + matches = [{app-id = "^org\.wezfurlong\.wezterm$";}]; + default-column-width.proportion = 1.0; + } + + { + matches = [ + { + app-id = "^floorp$"; + title = "^Picture-in-Picture$"; + } + {title = "^Picture in picture$";} + ]; + open-floating = true; + } + ] + ++ (lib.optionals (cfg.monitors != null) [ + { + matches = [ + { + app-id = "^floorp$"; + at-startup = true; + } + ]; + open-on-output = builtins.elemAt cfg.monitors 1; + default-column-width.proportion = 1.0; + } + ]); binds = with config.lib.niri.actions; { "Mod+Shift+Slash".action = show-hotkey-overlay;