From be7181943c75ccdf7c90171cf5b3777123058a07 Mon Sep 17 00:00:00 2001 From: Miran Bastaja Date: Sun, 12 Oct 2025 13:04:34 +0200 Subject: niri: set up named workspaces --- share/home/niri.nix | 105 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 83 insertions(+), 22 deletions(-) (limited to 'share/home') diff --git a/share/home/niri.nix b/share/home/niri.nix index e63d1d4..583c928 100644 --- a/share/home/niri.nix +++ b/share/home/niri.nix @@ -91,28 +91,89 @@ in screenshot-path = null; # clipboard only - window-rules = [ - # Open the Firefox picture-in-picture player as floating by default. - { - matches = [ { title = "^Picture-in-Picture$"; } ]; - open-floating = true; - } - - # Work around WezTerm's initial configure bug by setting an empty default-column-width. - { - matches = [ { app-id = ''^org\.wezfurlong\.wezterm$''; } ]; - default-column-width = null; - } - - { - matches = [ - { app-id = ''^org\.keepassxc\.KeePassXC$''; } - { app-id = ''^org\.gnome\.World\.Secrets$''; } - { app-id = ''^Bitwarden$''; } - ]; - block-out-from = "screen-capture"; - } - ]; + workspaces = { + "01-dev-1" = { + name = "dev-1"; + open-on-output = "eDP-1"; + }; + "02-dev-2" = { + name = "dev-2"; + open-on-output = "eDP-1"; + }; + "03-web" = { + name = "web"; + open-on-output = "eDP-1"; + }; + "04-chat" = { + name = "chat"; + open-on-output = "eDP-1"; + }; + "05-email" = { + name = "email"; + open-on-output = "eDP-1"; + }; + "06-misc-1" = { + name = "misc-1"; + open-on-output = "eDP-1"; + }; + "07-misc-2" = { + name = "misc-2"; + open-on-output = "eDP-1"; + }; + "08-misc-3" = { + name = "misc-3"; + open-on-output = "eDP-1"; + }; + "09-misc-4" = { + name = "misc-4"; + open-on-output = "eDP-1"; + }; + "10-misc-5" = { + name = "misc-5"; + open-on-output = "eDP-1"; + }; + }; + + window-rules = + let + default-workspace = app-id: workspace: { + matches = [ + { + at-startup = true; + inherit app-id; + } + ]; + open-on-workspace = workspace; + }; + in + [ + # Open the Firefox picture-in-picture player as floating by default. + { + matches = [ { title = "^Picture-in-Picture$"; } ]; + open-floating = true; + } + + # Work around WezTerm's initial configure bug by setting an empty default-column-width. + { + matches = [ { app-id = ''^org\.wezfurlong\.wezterm$''; } ]; + default-column-width = null; + } + + { + matches = [ + { app-id = ''^org\.keepassxc\.KeePassXC$''; } + { app-id = ''^org\.gnome\.World\.Secrets$''; } + { app-id = ''^Bitwarden$''; } + ]; + block-out-from = "screen-capture"; + } + + # Default app positions + (default-workspace "^librewolf$" "web") + (default-workspace "^discord$" "chat") + (default-workspace "^thunderbird$" "email") + (default-workspace "^Bitwarden$" "misc-1") + ]; binds = with config.lib.niri.actions; { # Shows a list of important hotkeys -- cgit v1.3.1