diff --git a/modules/desktop/niri.nix b/modules/desktop/niri.nix index aff7673..5870e07 100644 --- a/modules/desktop/niri.nix +++ b/modules/desktop/niri.nix @@ -21,8 +21,8 @@ wl-clipboard xsel + mako waybar - libnotify ]; xdg = { @@ -76,14 +76,6 @@ }: { 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; @@ -148,34 +140,8 @@ screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; - 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"; - } - ]; - + # TODO: block 1pass from screenshots and window capture + # TODO: move windows to workspaces where I expect them window-rules = [ { excludes = [ ]; @@ -186,109 +152,69 @@ bottom-left = 15.0; bottom-right = 15.0; }; - - # - open-fullscreen = false; } { matches = [ { is-window-cast-target = true; } ]; - border = { - enable = true; - width = 2; + focus-ring = { active.color = "#f38ba8"; - inactive.color = "#f38ba8"; + inactive.color = "#7d0d2d"; + }; + + border = { + inactive.color = "#7d0d2d"; }; shadow = { - color = "#f38ba870"; + color = "#7d0d2d70"; + }; + + tab-indicator = { + active.color = "#f38ba8"; + inactive.color = "#7d0d2d"; }; } - { - matches = [ - { - app-id = "1password"; - is-floating = true; - is-focused = false; - } - ]; - - } - { - 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 = "1Password"; + } { app-id = "steam"; title = "Friends List.*"; } ]; - open-on-workspace = "01-communication"; + open-on-output = "HDMI-A-1"; 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"; - } - ]; - - block-out-from = "screencast"; } ]; 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; @@ -299,15 +225,6 @@ "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; @@ -318,13 +235,6 @@ repeat = false; }; - "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; }; @@ -399,8 +309,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.maximize-column; - "Mod+Shift+F".action = actions.fullscreen-window; + "Mod+F".action = actions.fullscreen-window; + "Mod+Shift+F".action = actions.maximize-column; "Mod+Ctrl+F".action = actions.expand-column-to-available-width; "Mod+C".action = actions.center-column; @@ -455,6 +365,8 @@ allow-when-locked = true; }; } + focus-workspaces + move-to-workspaces ]; spawn-at-startup = [