From 371a430031933dde58a03de8a3c7c2dfcda3ada0 Mon Sep 17 00:00:00 2001 From: Christoph Hollizeck Date: Wed, 29 Oct 2025 12:37:52 +0100 Subject: [PATCH 1/4] niri: try to get rid of hyprland-ideas --- modules/desktop/niri.nix | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index 5870e07..0bec2b7 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -194,27 +194,6 @@ binds = with config.lib.niri; - let - workspaces = (builtins.genList (x: x + 1) 9); - - focus-workspaces = builtins.listToAttrs ( - map (num: { - name = "Mod+${toString num}"; - value = { - action.focus-workspace = num; - }; - }) workspaces - ); - move-to-workspaces = builtins.listToAttrs ( - map (num: { - name = "Mod+Ctrl+${toString num}"; - value = { - action.move-window-to-workspace = num; - }; - }) workspaces - ); - in - lib.mkMerge [ { "Mod+Shift+Slash".action = actions.show-hotkey-overlay; @@ -235,6 +214,11 @@ repeat = false; }; + "Mod+1".action = actions.focus-workspace "zen"; + "Mod+2".action = actions.focus-workspace "steam"; + "Mod+3".action = actions.focus-workspace "communication"; + "Mod+4".action = actions.focus-workspace "work"; + "Mod+J" = { action = actions.focus-window-or-workspace-down; }; @@ -365,8 +349,6 @@ allow-when-locked = true; }; } - focus-workspaces - move-to-workspaces ]; spawn-at-startup = [ From 2129b9cedf9f2fc620d90813cfb7cbf212036998 Mon Sep 17 00:00:00 2001 From: Christoph Hollizeck Date: Wed, 29 Oct 2025 16:46:31 +0100 Subject: [PATCH 2/4] niri: add screenshots sodiboo/niri-flake#1380 --- modules/desktop/niri.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index 0bec2b7..0f8cd12 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -204,6 +204,15 @@ "Mod+D".action.spawn = "${lib.getExe pkgs.fuzzel}"; "Mod+Alt+L".action.spawn = "hyprlock-blur"; + "Mod+Escape" = { + allow-inhibiting = false; + action = actions.toggle-keyboard-shortcuts-inhibit; + }; + + "Print".action.screenshot = [ ]; + "Ctrl+Print".action.screenshot-screen = [ ]; + "Alt+Print".action.screenshot-window = [ ]; + "Mod+Shift+Q" = { action = actions.close-window; repeat = false; From 4456200bd84ff09dc27e5f62a7ff91e5512a3bdc Mon Sep 17 00:00:00 2001 From: Christoph Hollizeck Date: Wed, 29 Oct 2025 16:47:10 +0100 Subject: [PATCH 3/4] niri: setup named workspaces --- modules/desktop/niri.nix | 131 ++++++++++++++++++++++++++++++++------- 1 file changed, 110 insertions(+), 21 deletions(-) diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index 0f8cd12..0ffa107 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -140,8 +140,34 @@ screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; - # TODO: block 1pass from screenshots and window capture - # TODO: move windows to workspaces where I expect them + workspaces = { + "01-zen" = { + open-on-output = "DP-1"; + }; + "02-steam" = { + open-on-output = "DP-1"; + }; + "03-work" = { + open-on-output = "DP-1"; + }; + "04-games" = { + open-on-output = "DP-1"; + }; + "01-communication" = { + open-on-output = "HDMI-A-1"; + }; + "02-1password" = { + open-on-output = "HDMI-A-1"; + }; + }; + + layer-rules = [ + { + matches = [ { namespace = "^notifications$"; } ]; + block-out-from = "screencast"; + } + ]; + window-rules = [ { excludes = [ ]; @@ -152,43 +178,104 @@ bottom-left = 15.0; bottom-right = 15.0; }; + + # + open-fullscreen = false; } { matches = [ { is-window-cast-target = true; } ]; - focus-ring = { - active.color = "#f38ba8"; - inactive.color = "#7d0d2d"; - }; - border = { - inactive.color = "#7d0d2d"; + enable = true; + width = 2; + active.color = "#f38ba8"; + inactive.color = "#f38ba8"; }; shadow = { - color = "#7d0d2d70"; + color = "#f38ba870"; }; + } + { + matches = [ + { + app-id = "1password"; + is-floating = true; + is-focused = false; + } + ]; - tab-indicator = { - active.color = "#f38ba8"; - inactive.color = "#7d0d2d"; - }; + } + { + matches = [ + { + app-id = "steam"; + title = "Steam"; + } + ]; + + open-on-workspace = "02-steam"; + open-maximized = true; + } + { + matches = [ + { + app-id = "steam_app_.*"; + } + { + app-id = "factorio"; + } + ]; + + open-on-workspace = "04-games"; + default-column-width.proportion = 1.0; + default-window-height.proportion = 1.0; + min-width = 3440; + min-height = 1440; } { matches = [ { app-id = "discord"; } + { + app-id = "steam"; + title = "Friends List.*"; + } + ]; + open-on-workspace = "01-communication"; + default-column-width.proportion = 1.0; + open-fullscreen = false; + } + { + matches = [ { app-id = "1Password"; } + ]; + + open-on-workspace = "02-1password"; + default-column-width.proportion = 1.0; + open-fullscreen = false; + } + { + matches = [ + { + app-id = "1Password"; + } + { + app-id = "discord"; + } { app-id = "steam"; title = "Friends List.*"; } + { + app-id = "teams-for-linux"; + } ]; - open-on-output = "HDMI-A-1"; - default-column-width.proportion = 1.0; + + block-out-from = "screencast"; } ]; @@ -223,10 +310,12 @@ repeat = false; }; - "Mod+1".action = actions.focus-workspace "zen"; - "Mod+2".action = actions.focus-workspace "steam"; - "Mod+3".action = actions.focus-workspace "communication"; - "Mod+4".action = actions.focus-workspace "work"; + "Mod+1".action = actions.focus-workspace "01-zen"; + "Mod+2".action = actions.focus-workspace "02-steam"; + "Mod+3".action = actions.focus-workspace "03-work"; + "Mod+4".action = actions.focus-workspace "04-games"; + "Mod+5".action = actions.focus-workspace "01-communication"; + "Mod+9".action = actions.focus-workspace "02-1password"; "Mod+J" = { action = actions.focus-window-or-workspace-down; @@ -302,8 +391,8 @@ "Mod+R".action = actions.switch-preset-column-width; "Mod+Shift+R".action = actions.switch-preset-window-height; "Mod+Ctrl+R".action = actions.reset-window-height; - "Mod+F".action = actions.fullscreen-window; - "Mod+Shift+F".action = actions.maximize-column; + "Mod+F".action = actions.maximize-column; + "Mod+Shift+F".action = actions.fullscreen-window; "Mod+Ctrl+F".action = actions.expand-column-to-available-width; "Mod+C".action = actions.center-column; From 890fcfc6ce6cd44eefec6f8176d026d1ddd9e7ed Mon Sep 17 00:00:00 2001 From: Christoph Hollizeck Date: Wed, 29 Oct 2025 16:47:25 +0100 Subject: [PATCH 4/4] niri: add mako service --- modules/desktop/niri.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index 0ffa107..aff7673 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -21,8 +21,8 @@ wl-clipboard xsel - mako waybar + libnotify ]; xdg = { @@ -76,6 +76,14 @@ }: { config = lib.mkIf (osConfig.networking.hostName == "yggdrasil" && osConfig.programs.niri.enable) { + services.mako = { + enable = true; + settings = { + border-radius = 15; + border-color = "#505050"; + background-color = "#00000070"; + }; + }; programs.niri.settings = { prefer-no-csd = true;