diff --git a/nix/users/ilkecan/utilities/zellij/layouts.nix b/nix/users/ilkecan/utilities/zellij/layouts.nix index 2b3af6e..d0a866d 100644 --- a/nix/users/ilkecan/utilities/zellij/layouts.nix +++ b/nix/users/ilkecan/utilities/zellij/layouts.nix @@ -12,12 +12,82 @@ let inherit (lib.my) importTree ; + + panes = { + bar = { + pane = { + _props = { + size = 1; + borderless = true; + }; + plugin._props.location = "zellij:compact-bar"; + }; + }; + + llmAgent = { + pane = { + _props.command = "codex"; + start_suspended = true; + }; + }; + + mkFloating = pane: { + floating_panes = { + pane = pane.pane // { + _props = { + x = "10%"; + y = "10%"; + width = "80%"; + height = "80%"; + } + // pane.pane._props; + }; + }; + }; + + shell = { + pane._props.command = config.home.defaultShell.meta.mainProgram; + }; + }; + + tabs = { + llmAgent = { + tab = { + _props = { + name = "LLM agent"; + hide_floating_panes = true; + }; + + _children = [ + panes.llmAgent + (panes.mkFloating panes.shell) + panes.bar + ]; + }; + }; + + neovim = { + tab = { + _props = { + name = "Neovim"; + focus = true; + hide_floating_panes = true; + }; + + _children = [ + { pane._props.command = "nvim"; } + (panes.mkFloating panes.llmAgent) + panes.bar + ]; + }; + }; + }; in { programs.zellij.layouts = importTree { root = ./layouts; depth = 1; - importFn = x: import x { inherit config; }; + importFn = x: import x { inherit panes tabs; }; normalizeNameFn = removeSuffix ".nix"; }; } diff --git a/nix/users/ilkecan/utilities/zellij/layouts/code.nix b/nix/users/ilkecan/utilities/zellij/layouts/code.nix index dbbbf4f..6c85fcd 100644 --- a/nix/users/ilkecan/utilities/zellij/layouts/code.nix +++ b/nix/users/ilkecan/utilities/zellij/layouts/code.nix @@ -1,66 +1,25 @@ { - config, + panes, + tabs, ... }: { layout._children = [ - { - tab = { - _props = { - name = "Neovim"; - focus = true; - hide_floating_panes = true; - }; - _children = [ - { pane._props.command = "nvim"; } - { - floating_panes.pane._props = { - command = "codex"; - x = "10%"; - y = "10%"; - width = "80%"; - height = "80%"; - }; - } - { - pane = { - _props = { - size = 1; - borderless = true; - }; - plugin._props.location = "zellij:compact-bar"; - }; - } - ]; - }; - } + tabs.llmAgent + tabs.neovim + { tab = { _props = { name = "terminal"; hide_floating_panes = true; }; + _children = [ - { pane._props.command = config.home.defaultShell.meta.mainProgram; } - { - floating_panes.pane._props = { - command = "zsh"; - x = "10%"; - y = "10%"; - width = "80%"; - height = "80%"; - }; - } - { - pane = { - _props = { - size = 1; - borderless = true; - }; - plugin._props.location = "zellij:compact-bar"; - }; - } + panes.shell + (panes.mkFloating panes.shell) + panes.bar ]; }; } diff --git a/nix/users/ilkecan/utilities/zellij/layouts/rust.nix b/nix/users/ilkecan/utilities/zellij/layouts/rust.nix index 330d09c..6d0664f 100644 --- a/nix/users/ilkecan/utilities/zellij/layouts/rust.nix +++ b/nix/users/ilkecan/utilities/zellij/layouts/rust.nix @@ -1,99 +1,60 @@ { - config, + panes, + tabs, ... }: +let + mkCargoPane = args: { + pane = { + _props.name = "cargo"; + command = "cargo"; + inherit args; + start_suspended = true; + }; + }; +in { layout._children = [ - { - tab = { - _props = { - name = "Neovim"; - focus = true; - hide_floating_panes = true; - }; - _children = [ - { pane._props.command = "nvim"; } - { - floating_panes.pane._props = { - command = "codex"; - x = "10%"; - y = "10%"; - width = "80%"; - height = "80%"; - }; - } - { - pane = { - _props = { - size = 1; - borderless = true; - }; - plugin._props.location = "zellij:compact-bar"; - }; - } - ]; - }; - } + tabs.llmAgent + tabs.neovim + { tab = { _props = { name = "terminal"; hide_floating_panes = true; }; + _children = [ { pane = { _props.split_direction = "vertical"; _children = [ - { pane._props.command = config.home.defaultShell.meta.mainProgram; } + panes.shell { pane = { _props.split_direction = "horizontal"; _children = [ - { - cargo.args = [ - "clippy" - "--all-targets" - "--" - "--deny" - "warnings" - ]; - } - { cargo.args = [ "test" ]; } + (mkCargoPane [ + "clippy" + "--all-targets" + "--" + "--deny" + "warnings" + ]) + (mkCargoPane [ "test" ]) ]; }; } ]; }; } - { - floating_panes.pane._props = { - command = "zsh"; - x = "10%"; - y = "10%"; - width = "80%"; - height = "80%"; - }; - } - { - pane = { - _props = { - size = 1; - borderless = true; - }; - plugin._props.location = "zellij:compact-bar"; - }; - } + + (panes.mkFloating panes.shell) + panes.bar ]; }; } - { - pane_template = { - _props.name = "cargo"; - command = "cargo"; - start_suspended = true; - }; - } ]; } diff --git a/nix/users/ilkecan/wayland/default.nix b/nix/users/ilkecan/wayland/default.nix index 1a1d100..6b08d13 100644 --- a/nix/users/ilkecan/wayland/default.nix +++ b/nix/users/ilkecan/wayland/default.nix @@ -30,16 +30,18 @@ in { imports = collectImports ./.; - dbus.packages = [ - pkgs.nautilus # required for xdg-desktop-portal-gnome's FileChooser to work properly + dbus.packages = with pkgs; [ + nautilus # required for xdg-desktop-portal-gnome's FileChooser to work properly ]; home = { packages = with pkgs; [ + slurp # https://github.com/emersion/slurp + unstable.xwayland-satellite + wayfreeze # https://github.com/Jappie3/wayfreeze wev wl-clipboard-rs xeyes - unstable.xwayland-satellite ]; sessionVariables = mkMerge [ diff --git a/nix/users/ilkecan/wayland/niri/window-rules.nix b/nix/users/ilkecan/wayland/niri/window-rules.nix index 8c08938..644ea63 100644 --- a/nix/users/ilkecan/wayland/niri/window-rules.nix +++ b/nix/users/ilkecan/wayland/niri/window-rules.nix @@ -109,6 +109,10 @@ open-maximized = true; open-on-workspace = "news"; } + { + matches = [ { app-id = "^vlc$"; } ]; + open-maximized = true; + } { matches = [ { app-id = "^wasistlos$"; } ]; block-out-from = "screen-capture";