From 763426c05b9a1f40579c5730501b74bbfa93a3f9 Mon Sep 17 00:00:00 2001 From: mrfluffy Date: Mon, 26 Jan 2026 20:51:19 +0000 Subject: [PATCH] niri --- dots/niri.nix | 645 ++++++++------------------ dots/river.nix | 250 ---------- dots/waybar.nix | 44 +- dots/xdg.nix | 1 - dots/zsh.nix | 1 - flake.lock | 128 ++++- flake.nix | 6 +- home/common.nix | 3 +- home/stylix.nix | 1 - result | 2 +- system/specialisation/main-system.nix | 11 +- 11 files changed, 343 insertions(+), 749 deletions(-) delete mode 100755 dots/river.nix diff --git a/dots/niri.nix b/dots/niri.nix index a099b7a..9feb576 100755 --- a/dots/niri.nix +++ b/dots/niri.nix @@ -1,461 +1,226 @@ { - config, lib, pkgs, + window_manager, + systemName, ... }: +let + isLaptop = systemName == "laptop"; +in { - programs = { - niri = { - settings = { - input = { - keyboard = { - xkb = { - # You can set rules, model, layout, variant and options. - # For more information, see xkeyboard-config(7). + programs.niri = { + enable = window_manager == "niri" || window_manager == "all"; - # For example: - # layout "us,ru" - # options "grp:win_space_toggle,compose:ralt,ctrl:nocaps" - }; - - # Enable numlock on startup, omitting this setting disables it. - numlock = true; - }; - - # Next sections include libinput settings. - # Omitting settings disables them, or leaves them at their default values. - # All commented-out settings here are examples, not defaults. - touchpad = { - # off - tap = true; - # dwt - # dwtp - # drag false - # drag-lock - natural-scroll = true; - # accel-speed 0.2 - # accel-profile "flat" - # scroll-method "two-finger" - # disabled-on-external-mouse - }; - - mouse = { - # off - # natural-scroll - # accel-speed 0.2 - # accel-profile "flat" - # scroll-method "no-scroll" - }; - - trackpoint = { - # off - # natural-scroll - # accel-speed 0.2 - # accel-profile "flat" - # scroll-method "on-button-down" - # scroll-button 273 - # scroll-button-lock - # middle-emulation - }; - - # Uncomment this to make the mouse warp to the center of newly focused windows. - # warp-mouse-to-focus - - # Focus windows and outputs automatically when moving the mouse into them. - # Setting max-scroll-amount="0%" makes it work only on windows already fully on screen. - # focus-follows-mouse max-scroll-amount="0%" - }; - # You can configure outputs by their name, which you can find - # by running `niri msg outputs` while inside a niri instance. - # The built-in laptop monitor is usually called "eDP-1". - # Find more information on the wiki: - # https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs - # Remember to uncomment the node by removing "/-"! - outputs."eDP-1" = { - # Uncomment this line to disable this output. - # off - - # Resolution and, optionally, refresh rate of the output. - # The format is "x" or "x@". - # If the refresh rate is omitted, niri will pick the highest refresh rate - # for the resolution. - # If the mode is omitted altogether or is invalid, niri will pick one automatically. - # Run `niri msg outputs` while inside a niri instance to list all outputs and their modes. - mode = { - width = 1920; - height = 1080; - refresh = 60.00; - }; - - # You can use integer or fractional scale, for example use 1.5 for 150% scale. - scale = 1.0; - - # Transform allows to rotate the output counter-clockwise, valid values are: - # normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270. - # transform = "normal"; - - # Position of the output in the global coordinate space. - # This affects directional monitor actions like "focus-monitor-left", and cursor movement. - # The cursor can only move between directly adjacent outputs. - # Output scale and rotation has to be taken into account for positioning: - # outputs are sized in logical, or scaled, pixels. - # For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080, - # so to put another output directly adjacent to it on the right, set its x to 1920. - # If the position is unset or results in an overlap, the output is instead placed - # automatically. - position = { - x = 1280; - y = 0; - }; + settings = { + # Input configuration + input = { + keyboard = { + xkb.layout = "ie"; + numlock = true; }; - # Settings that influence how windows are positioned and sized. - # Find more information on the wiki: - # https://github.com/YaLTeR/niri/wiki/Configuration:-Layout - layout = { - # Set gaps around windows in logical pixels. - gaps = 16; - - # When to center a column when changing focus, options are: - # - "never", default behavior, focusing an off-screen column will keep at the left - # or right edge of the screen. - # - "always", the focused column will always be centered. - # - "on-overflow", focusing a column will center it if it doesn't fit - # together with the previously focused column. - center-focused-column = "never"; - - # You can customize the widths that "switch-preset-column-width" (Mod+R) toggles between. - preset-column-widths = [ - # Proportion sets the width as a fraction of the output width, taking gaps into account. - # For example, you can perfectly fit four windows sized "proportion 0.25" on an output. - # The default preset widths are 1/3, 1/2 and 2/3 of the output. - { proportion = 0.33333; } - { proportion = 0.5; } - { proportion = 0.66667; } - - # Fixed sets the width in logical pixels exactly. - # fixed 1920 - ]; - - # You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between. - # preset-window-heights { } - - # You can change the default width of the new windows. - default-column-width = { - proportion = 0.5; - }; - # If you leave the brackets empty, the windows themselves will decide their initial width. - # default-column-width {} - - # By default focus ring and border are rendered as a solid background rectangle - # behind windows. That is, they will show up through semitransparent windows. - # This is because windows using client-side decorations can have an arbitrary shape. - # - # If you don't like that, you should uncomment `prefer-no-csd` below. - # Niri will draw focus ring and border *around* windows that agree to omit their - # client-side decorations. - # - # Alternatively, you can override it with a window rule called - # `draw-border-with-background`. - - # You can change how the focus ring looks. - focus-ring = { - # Uncomment this line to disable the focus ring. - # off - - # How many logical pixels the ring extends out from the windows. - width = 4; - - # Colors can be set in a variety of ways: - # - CSS named colors: "red" - # - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa" - # - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others. - - # Color of the ring on the active monitor. - active = { - color = "#7fc8ff"; - }; - - # Color of the ring on inactive monitors. - # - # The focus ring only draws around the active window, so the only place - # where you can see its inactive-color is on other monitors. - inactive = { - color = "#505050"; - }; - - # You can also use gradients. They take precedence over solid colors. - # Gradients are rendered the same as CSS linear-gradient(angle, from, to). - # The angle is the same as in linear-gradient, and is optional, - # defaulting to 180 (top-to-bottom gradient). - # You can use any CSS linear-gradient tool on the web to set these up. - # Changing the color space is also supported, check the wiki for more info. - # - # active-gradient from="#80c8ff" to="#c7ff7f" angle=45 - - # You can also color the gradient relative to the entire view - # of the workspace, rather than relative to just the window itself. - # To do that, set relative-to="workspace-view". - # - # inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" - }; - - # You can also add a border. It's similar to the focus ring, but always visible. - border = { - # The settings are the same as for the focus ring. - # If you enable the border, you probably want to disable the focus ring. - enable = true; - - width = 4; - active = { - color = "#ffc87f"; - }; - inactive = { - color = "#505050"; - }; - - # Color of the border around windows that request your attention. - urgent = { - color = "#9b0000"; - }; - - # Gradients can use a few different interpolation color spaces. - # For example, this is a pastel rainbow gradient via in="oklch longer hue". - # - # active-gradient from="#e5989b" to="#ffb4a2" angle=45 relative-to="workspace-view" in="oklch longer hue" - - # inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" - }; - - # You can enable drop shadows for windows. - shadow = { - # Uncomment the next line to enable shadows. - # on - - # By default, the shadow draws only around its window, and not behind it. - # Uncomment this setting to make the shadow draw behind its window. - # - # Note that niri has no way of knowing about the CSD window corner - # radius. It has to assume that windows have square corners, leading to - # shadow artifacts inside the CSD rounded corners. This setting fixes - # those artifacts. - # - # However, instead you may want to set prefer-no-csd and/or - # geometry-corner-radius. Then, niri will know the corner radius and - # draw the shadow correctly, without having to draw it behind the - # window. These will also remove client-side shadows if the window - # draws any. - # - # draw-behind-window true - - # You can change how shadows look. The values below are in logical - # pixels and match the CSS box-shadow properties. - - # Softness controls the shadow blur radius. - softness = 30; - - # Spread expands the shadow. - spread = 5; - - # Offset moves the shadow relative to the window. - offset = { - x = 0; - y = 5; - }; - - # You can also change the shadow color and opacity. - color = "#0007"; - }; - - # Struts shrink the area occupied by windows, similarly to layer-shell panels. - # You can think of them as a kind of outer gaps. They are set in logical pixels. - # Left and right struts will cause the next window to the side to always be visible. - # Top and bottom struts will simply add outer gaps in addition to the area occupied by - # layer-shell panels and regular gaps. - struts = { - # left 64 - # right 64 - # top 64 - # bottom 64 - }; + touchpad = { + tap = true; + natural-scroll = true; + dwt = true; }; - # Add lines like this to spawn processes at startup. - # Note that running niri as a session supports xdg-desktop-autostart, - # which may be more convenient to use. - # See the binds section below for more spawn examples. - spawn-at-startup = [ - { - command = [ "xwayland-satellite" ]; - } - { - command = [ "foot -s" ]; - } + + mouse = { + accel-profile = "flat"; + }; + + warp-mouse-to-focus.enable = true; + focus-follows-mouse.enable = true; + }; + + # Layout settings + layout = { + gaps = 8; + center-focused-column = "never"; + + preset-column-widths = [ + { proportion = 1.0 / 3.0; } + { proportion = 1.0 / 2.0; } + { proportion = 2.0 / 3.0; } ]; - # Uncomment this line to ask the clients to omit their client-side decorations if possible. - # If the client will specifically ask for CSD, the request will be honored. - # Additionally, clients will be informed that they are tiled, removing some client-side rounded corners. - # This option will also fix border/focus ring drawing behind some semitransparent windows. - # After enabling or disabling this, you need to restart the apps for this to take effect. - # prefer-no-csd - # You can change the path where screenshots are saved. - # A ~ at the front will be expanded to the home directory. - # The path is formatted with strftime(3) to give you the screenshot date and time. - #sreenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; - # You can also set this to null to disable saving screenshots to disk. - # screenshot-path null - #/ Animation settings. - # The wiki explains how to configure individual animations: - # https://github.com/YaLTeR/niri/wiki/Configuration:-Animations - animations = { - # Uncomment to turn off all animations. - # off - # Slow down all animations by this factor. Values below 1 speed them up instead. - # slowdown 3.0 + default-column-width = { proportion = 1.0 / 2.0; }; + + focus-ring = { + enable = true; + width = 2; + active.color = "#7fc8ff"; + inactive.color = "#505050"; }; - # Window rules let you adjust behavior for individual windows. - # Find more information on the wiki: - # https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules - #/ Work around WezTerm's initial configure bug - # by setting an empty default-column-width. - window-rules = [ - # This regular expression is intentionally made as specific as possible, - # since this is the default config, and we want no false positives. - # You can get away with just app-id="wezterm" if you want. - #match = { app-id=#"^org\.wezfurlong\.wezterm$"\#}; - #default-column-width = {} - ]; - environment = { - DISPLAY = ":0"; + + border = { + enable = true; + width = 2; + active.color = "#ffc87f"; + inactive.color = "#505050"; }; - binds = with config.lib.niri.actions; { - # App launchers - "Alt+Return".action = spawn "footclient"; - "Alt+D".action = spawn "anyrun"; - "Super+Alt+L".action = spawn "${lib.getExe pkgs.hyprlock}"; - # Audio control - "XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; - "XF86AudioLowerVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; - "XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; - "XF86AudioMicMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; - - # Brightness control - "XF86MonBrightnessUp".action = spawn "brightnessctl" "--class=backlight" "set" "+10%"; - "XF86MonBrightnessDown".action = spawn "brightnessctl" "--class=backlight" "set" "10%-"; - - # Overview and quitting - "Alt+O".action = toggle-overview; - "Alt+Q".action = close-window; - "Alt+Shift+E".action = quit; - "Alt+Ctrl+Shift+E".action = quit { skip-confirmation = true; }; - - # Navigation - "Alt+H".action = focus-column-left; - "Alt+J".action = focus-window-down; - "Alt+K".action = focus-window-up; - "Alt+L".action = focus-column-right; - - "Alt+Ctrl+H".action = move-column-left; - "Alt+Ctrl+J".action = move-window-down; - "Alt+Ctrl+K".action = move-window-up; - "Alt+Ctrl+L".action = move-column-right; - - "Alt+Shift+H".action = focus-monitor-left; - "Alt+Shift+J".action = focus-monitor-down; - "Alt+Shift+K".action = focus-monitor-up; - "Alt+Shift+L".action = focus-monitor-right; - - "Alt+Shift+Ctrl+H".action = move-column-to-monitor-left; - "Alt+Shift+Ctrl+J".action = move-column-to-monitor-down; - "Alt+Shift+Ctrl+K".action = move-column-to-monitor-up; - "Alt+Shift+Ctrl+L".action = move-column-to-monitor-right; - - "Alt+U".action = focus-workspace-down; - "Alt+I".action = focus-workspace-up; - "Alt+Ctrl+U".action = move-column-to-workspace-down; - "Alt+Ctrl+I".action = move-column-to-workspace-up; - "Alt+Shift+U".action = move-workspace-down; - "Alt+Shift+I".action = move-workspace-up; - - # Scroll bindings - "Alt+WheelScrollDown".action = focus-workspace-down; - "Alt+WheelScrollUp".action = focus-workspace-up; - "Alt+Ctrl+WheelScrollDown".action = move-column-to-workspace-down; - "Alt+Ctrl+WheelScrollUp".action = move-column-to-workspace-up; - - "Alt+WheelScrollLeft".action = focus-column-left; - "Alt+WheelScrollRight".action = focus-column-right; - "Alt+Ctrl+WheelScrollLeft".action = move-column-left; - "Alt+Ctrl+WheelScrollRight".action = move-column-right; - - "Alt+Shift+WheelScrollUp".action = focus-column-left; - "Alt+Shift+WheelScrollDown".action = focus-column-right; - "Alt+Ctrl+Shift+WheelScrollUp".action = move-column-left; - "Alt+Ctrl+Shift+WheelScrollDown".action = move-column-right; - - # Workspace numbers (1–9) - "Alt+1".action = focus-workspace 1; - "Alt+2".action = focus-workspace 2; - "Alt+3".action = focus-workspace 3; - "Alt+4".action = focus-workspace 4; - "Alt+5".action = focus-workspace 5; - "Alt+6".action = focus-workspace 6; - "Alt+7".action = focus-workspace 7; - "Alt+8".action = focus-workspace 8; - "Alt+9".action = focus-workspace 9; - - "Alt+Ctrl+1".action = move-column-to-index 1; - "Alt+Ctrl+2".action = move-column-to-index 2; - "Alt+Ctrl+3".action = move-column-to-index 3; - "Alt+Ctrl+4".action = move-column-to-index 4; - "Alt+Ctrl+5".action = move-column-to-index 5; - "Alt+Ctrl+6".action = move-column-to-index 6; - "Alt+Ctrl+7".action = move-column-to-index 7; - "Alt+Ctrl+8".action = move-column-to-index 8; - "Alt+Ctrl+9".action = move-column-to-index 9; - - # Window & column management - "Alt+Comma".action = consume-window-into-column; - "Alt+Period".action = expel-window-from-column; - "Alt+BracketLeft".action = consume-or-expel-window-left; - "Alt+BracketRight".action = consume-or-expel-window-right; - - "Alt+F".action = maximize-column; - "Alt+Shift+F".action = fullscreen-window; - "Alt+Ctrl+F".action = expand-column-to-available-width; - - "Alt+C".action = center-column; - "Alt+Ctrl+C".action = center-visible-columns; - - "Alt+Minus".action = set-column-width "-10%"; - "Alt+Plus".action = set-column-width "+10%"; - "Alt+Shift+Minus".action = set-window-height "-10%"; - "Alt+Shift+Plus".action = set-window-height "+10%"; - - "Alt+R".action = switch-preset-column-width; - "Alt+Shift+R".action = switch-preset-window-height; - "Alt+Ctrl+R".action = reset-window-height; - - "Alt+V".action = toggle-window-floating; - "Alt+Shift+V".action = switch-focus-between-floating-and-tiling; - - "Alt+W".action = toggle-column-tabbed-display; - - # Screenshots - #"Print".action = screenshot { show-pointer = false; }; - "Ctrl+Print".action.screenshot-screen = { - write-to-disk = false; - }; - #"Alt+Print".action = screenshot-window; - - # Other - "Alt+Escape".action = toggle-keyboard-shortcuts-inhibit; - "Alt+Shift+P".action = power-off-monitors; + shadow = { + enable = true; + softness = 30; + spread = 5; + offset = { x = 0; y = 5; }; + color = "#00000070"; }; }; + + # Startup programs + spawn-at-startup = [ + { command = [ "xwayland-satellite" ]; } + #{ command = [ "waybar" ]; } + { command = [ "foot" "--server" ]; } + #{ command = [ "swaybg" "-i" "${../assets/Wallpapers/138.png}" "-m" "fill" ]; } + ]; + + # Prefer server-side decorations + prefer-no-csd = true; + + # Screenshot path + screenshot-path = "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"; + + # Environment variables + environment = { + DISPLAY = ":0"; + }; + + # Hotkey overlay settings + hotkey-overlay.skip-at-startup = true; + + # Keybinds + binds = { + # App launchers + "Mod+Return".action.spawn = [ "footclient" ]; + "Mod+D".action.spawn = [ "anyrun" ]; + "Mod+E".action.spawn = [ "dolphin" ]; + "Super+Alt+L".action.spawn = [ "swaylock" ]; + + # Audio control + "XF86AudioRaiseVolume".action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+" ]; + "XF86AudioLowerVolume".action.spawn = [ "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-" ]; + "XF86AudioMute".action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle" ]; + "XF86AudioMicMute".action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle" ]; + + # Brightness control (laptop) + "XF86MonBrightnessUp".action.spawn = [ "brightnessctl" "--class=backlight" "set" "+10%" ]; + "XF86MonBrightnessDown".action.spawn = [ "brightnessctl" "--class=backlight" "set" "10%-" ]; + + # Window management + "Mod+Q".action.close-window = {}; + "Mod+Shift+E".action.quit = {}; + "Mod+Shift+Slash".action.show-hotkey-overlay = {}; + + # Focus navigation (vim-style) + "Mod+H".action.focus-column-left = {}; + "Mod+J".action.focus-window-down = {}; + "Mod+K".action.focus-window-up = {}; + "Mod+L".action.focus-column-right = {}; + + # Move windows + "Mod+Shift+H".action.move-column-left = {}; + "Mod+Shift+J".action.move-window-down = {}; + "Mod+Shift+K".action.move-window-up = {}; + "Mod+Shift+L".action.move-column-right = {}; + + # Monitor focus + "Mod+Ctrl+H".action.focus-monitor-left = {}; + "Mod+Ctrl+J".action.focus-monitor-down = {}; + "Mod+Ctrl+K".action.focus-monitor-up = {}; + "Mod+Ctrl+L".action.focus-monitor-right = {}; + + # Move to monitor + "Mod+Ctrl+Shift+H".action.move-column-to-monitor-left = {}; + "Mod+Ctrl+Shift+J".action.move-column-to-monitor-down = {}; + "Mod+Ctrl+Shift+K".action.move-column-to-monitor-up = {}; + "Mod+Ctrl+Shift+L".action.move-column-to-monitor-right = {}; + + # Workspace navigation + "Mod+U".action.focus-workspace-down = {}; + "Mod+I".action.focus-workspace-up = {}; + "Mod+Shift+U".action.move-column-to-workspace-down = {}; + "Mod+Shift+I".action.move-column-to-workspace-up = {}; + + # Workspace numbers + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + + "Mod+Shift+1".action.move-column-to-workspace = 1; + "Mod+Shift+2".action.move-column-to-workspace = 2; + "Mod+Shift+3".action.move-column-to-workspace = 3; + "Mod+Shift+4".action.move-column-to-workspace = 4; + "Mod+Shift+5".action.move-column-to-workspace = 5; + "Mod+Shift+6".action.move-column-to-workspace = 6; + "Mod+Shift+7".action.move-column-to-workspace = 7; + "Mod+Shift+8".action.move-column-to-workspace = 8; + "Mod+Shift+9".action.move-column-to-workspace = 9; + + # Column management + "Mod+Comma".action.consume-window-into-column = {}; + "Mod+Period".action.expel-window-from-column = {}; + "Mod+BracketLeft".action.consume-or-expel-window-left = {}; + "Mod+BracketRight".action.consume-or-expel-window-right = {}; + + # Window sizing + "Mod+F".action.maximize-column = {}; + "Mod+Shift+F".action.fullscreen-window = {}; + "Mod+C".action.center-column = {}; + + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; + + "Mod+R".action.switch-preset-column-width = {}; + "Mod+Shift+R".action.switch-preset-window-height = {}; + + # Floating + "Mod+V".action.toggle-window-floating = {}; + "Mod+Shift+V".action.switch-focus-between-floating-and-tiling = {}; + + # Tabs + "Mod+W".action.toggle-column-tabbed-display = {}; + + # Screenshots + "Print".action.screenshot = {}; + "Ctrl+Print".action.screenshot-screen = {}; + "Alt+Print".action.screenshot-window = {}; + + # Misc + "Mod+Escape".action.toggle-keyboard-shortcuts-inhibit = {}; + "Mod+Shift+P".action.power-off-monitors = {}; + + # Scroll bindings + "Mod+WheelScrollDown".action.focus-workspace-down = {}; + "Mod+WheelScrollUp".action.focus-workspace-up = {}; + "Mod+WheelScrollLeft".action.focus-column-left = {}; + "Mod+WheelScrollRight".action.focus-column-right = {}; + }; + + # Window rules + window-rules = [ + # Float file dialogs + { + matches = [{ title = "^Open File$"; }]; + open-floating = true; + } + { + matches = [{ title = "^Save File$"; }]; + open-floating = true; + } + ]; }; }; } diff --git a/dots/river.nix b/dots/river.nix deleted file mode 100755 index e43b21b..0000000 --- a/dots/river.nix +++ /dev/null @@ -1,250 +0,0 @@ -{ - config, - lib, - pkgs, - window_manager, - systemName, - ... -}: - -let - isLaptop = systemName == "laptop"; - isPc = systemName == "pc"; -in -{ - wayland.windowManager.river = { - enable = window_manager == "river" || window_manager == "all"; - xwayland.enable = true; - extraConfig = '' - #!/bin/sh - # - # - #systemctl --user import-environment - # - # - #eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh) - #export SSH_AUTH_SOCK - browser="zen" - file_manager="dolphin" - terminal="footclient" - drunner="anyrun" - editor="emacs" - - riverctl input "pointer-2362-8197-ASUP1204:00_093A:2005_Touchpad" tap enabled - riverctl keyboard-layout -options "grp:ctrl_space_toggle" ${ - if isLaptop - then "ie,us" - else "us" - } - - #riverctl spawn 'export XDG_CURRENT_DESKTOP=river' - #riverctl spawn 'systemctl --user restart xdg-desktop-portal' - riverctl spawn 'dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP' - riverctl spawn 'swaybg ${ - lib.optionalString isLaptop "-o eDP-1 -i ${../assets/Wallpapers/138.png}" - }${ - lib.optionalString isPc "-o HDMI-A-1 -i ${../assets/Wallpapers/138.png} -o DP-1 -i ${../assets/Wallpapers/138.png}" - }' - #riverctl spawn '/home/mrfluffy/.config/script/mic-gain-fix.sh' - riverctl spawn 'waybar &' - #riverctl spawn '(hypridle &) && loginctl unlock-session' - #riverctl spawn '(sleep 10 && systemctl --user restart hypridle.service) &' - #riverctl spawn '/nix/store/$(ls -la /nix/store | grep "polkit-gnome" | grep "^d" | awk ""$0=$NF" | head -n 1)/libexec/polkit-gnome-authentication-agent-1' - riverctl spawn ' ${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1' - riverctl spawn '/home/mrfluffy/.config/script/waylock.sh' - riverctl spawn 'fcitx5 -d' - riverctl spawn 'foot -s' - riverctl spawn '[ -n "$(whereis swaync | awk '{print $2}')" ] && swaync' - riverctl spawn 'nm-applet' - riverctl focus-follows-cursor normal - riverctl set-cursor-warp on-focus-change - #riverctl xcursor-theme oreo_spark_pink_cursors - riverctl spawn '${ - lib.optionalString isLaptop "wlr-randr --output eDP-1 --mode 1920x1080@60" - }${ - lib.optionalString isPc "wlr-randr --output DP-1 --mode 2560x1440@144 --pos 1920,0 --output HDMI-A-1 --mode 1920x1080@60 --pos 0,0" - }' - - # This is the example configuration file for river. - # - # If you wish to edit this, you will probably want to copy it to - # $XDG_CONFIG_HOME/river/init or $HOME/.config/river/init first. - # - # See the river(1), riverctl(1), and rivertile(1) man pages for complete - # documentation. - - # Note: the "Mod4" modifier is also known as Logo, GUI, Windows, Mod4, etc. - # - riverctl map normal Mod1+Shift+Control L spawn way-inhibitor - - # Mod4+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot) - riverctl map normal Mod1 Return spawn $terminal - - # Mod4+D open wofi - riverctl map normal Mod1 D spawn $drunner - - #Mod4+b open browser - riverctl map normal Mod1 B spawn $browser - - #Mod1+F open file manager - riverctl map normal Mod1 F spawn $file_manager - - #mod1+e open emacs - riverctl map normal Mod1 E spawn $editor - - # Mod4+Q to close the focused view - riverctl map normal Mod1 Q close - - # Mod4+Shift+E to exit river - riverctl map normal Mod1+Shift Q exit - - # Mod4+J and Super+K to focus the next/previous view in the layout stack - riverctl map normal Mod1 J focus-view next - riverctl map normal Mod1 K focus-view previous - - # Mod4+Shift+J and Super+Shift+K to swap the focused view with the next/previous - # view in the layout stack - riverctl map normal Mod1+Shift J swap next - riverctl map normal Mod1+Shift K swap previous - - # Mod4+Period and Super+Comma to focus the next/previous output - riverctl map normal Mod1 L focus-output next - riverctl map normal Mod1 H focus-output previous - - # Mod4+Shift+{Period,Comma} to send the focused view to the next/previous output - riverctl map normal Mod1+Shift L send-to-output next - riverctl map normal Mod1+Shift H send-to-output previous - - # Mod4+Return to bump the focused view to the top of the layout stack - riverctl map normal Mod4 Return zoom - - # Mod4+H and Super+L to decrease/increase the main ratio of rivertile(1) - riverctl map normal Mod1+Control H send-layout-cmd rivertile "main-ratio -0.05" - riverctl map normal Mod1+Control L send-layout-cmd rivertile "main-ratio +0.05" - - # Mod4+Mod1+{H,J,K,L} to move views - riverctl map normal Mod4+Mod1 H move left 100 - riverctl map normal Mod4+Mod1 J move down 100 - riverctl map normal Mod4+Mod1 K move up 100 - riverctl map normal Mod4+Mod1 L move right 100 - - # Mod4+Mod1+Control+{H,J,K,L} to snap views to screen edges - riverctl map normal Mod4+Mod1+Control H snap left - riverctl map normal Mod4+Mod1+Control J snap down - riverctl map normal Mod4+Mod1+Control K snap up - riverctl map normal Mod4+Mod1+Control L snap right - - # Mod4+Mod1+Shif+{H,J,K,L} to resize views - riverctl map normal Mod4+Mod1+Shift H resize horizontal -100 - riverctl map normal Mod4+Mod1+Shift J resize vertical 100 - riverctl map normal Mod4+Mod1+Shift K resize vertical -100 - riverctl map normal Mod4+Mod1+Shift L resize horizontal 100 - - # Mod4 + Left Mouse Button to move views - riverctl map-pointer normal Alt BTN_LEFT move-view - - # Mod4 + Right Mouse Button to resize views - riverctl map-pointer normal Alt BTN_RIGHT resize-view - - for i in $(seq 1 9); do - tags=$((1 << ($i - 1))) - - # Mod4+[1-9] to focus tag [0-8] - riverctl map normal Mod1 $i set-focused-tags $tags - - # Mod4+Shift+[1-9] to tag focused view with tag [0-8] - riverctl map normal Mod1+Shift $i set-view-tags $tags - - # Mod4+Ctrl+[1-9] to toggle focus of tag [0-8] - riverctl map normal Mod1+Control $i toggle-focused-tags $tags - - # Mod4+Shift+Ctrl+[1-9] to toggle tag [0-8] of focused view - riverctl map normal Mod1+Shift+Control $i toggle-view-tags $tags - done - - # Mod4+0 to focus all tags - # Mod4+Shift+0 to tag focused view with all tags - all_tags=$(((1 << 32) - 1)) - riverctl map normal Mod4 0 set-focused-tags $all_tags - riverctl map normal Mod4+Shift 0 set-view-tags $all_tags - - # Mod4+Space to toggle float - riverctl map normal Mod1 Space toggle-float - - # Mod4+F to toggle fullscreen - riverctl map normal Mod1 t toggle-fullscreen - - # Mod4+{Up,Right,Down,Left} to change layout orientation - riverctl map normal Mod4 Up send-layout-cmd rivertile "main-location top" - riverctl map normal Mod4 Right send-layout-cmd rivertile "main-location right" - riverctl map normal Mod4 Down send-layout-cmd rivertile "main-location bottom" - riverctl map normal Mod4 Left send-layout-cmd rivertile "main-location left" - - # Declare a passthrough mode. This mode has only a single mapping to return to - # normal mode. This makes it useful for testing a nested wayland compositor - riverctl declare-mode passthrough - - # Mod4+F11 to enter passthrough mode - riverctl map normal Mod4 F11 enter-mode passthrough - - # Mod4+F11 to return to normal mode - riverctl map passthrough Mod4 F11 enter-mode normal - - # Various media key mapping examples for both normal and locked mode which do - # not have a modifier - for mode in normal locked; do - # Eject the optical drive (well if you still have one that is) - riverctl map $mode None XF86Eject spawn 'eject -T' - - # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer) - riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5' - riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5' - riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute' - - # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl) - riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' - riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' - riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' - riverctl map $mode None XF86AudioNext spawn 'playerctl next' - #print screen - riverctl map $mode None Print spawn 'grim -g "$(slurp)" - | swappy -f -' - # Control screen backlight brighness with light (https://github.com/haikarainen/light) - riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5' - riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5' - done - - #make a raw mode - riverctl declare-mode raw - riverctl map normal Mod1 r spawn 'riverctl enter-mode raw' - riverctl map raw Mod1 r spawn 'riverctl enter-mode normal' - - - - # Set background and border color - #riverctl background-color 0x002b36 - #riverctl border-color-focused 0x8218c4 - #riverctl border-color-unfocused 0xff282a36 - #riverctl border-width 3 - - #set ssd for apps - riverctl rule-add ssd - - # Set keyboard repeat rate - riverctl set-repeat 50 300 - - # Make certain views start floating - riverctl float-filter-add app-id float - riverctl float-filter-add title "popup title with spaces" - riverctl rule-add -title "Idle Inhibitor" float - # Set app-ids and titles of views which should use client side decorations - riverctl csd-filter-add app-id "gedit" - - # Set and exec into the default layout generator, rivertile. - # River will send the process group of the init executable SIGTERM on exit. - riverctl default-layout rivertile - exec rivertile -view-padding 3 -outer-padding 3 -main-ratio 0.5 - - ''; - - }; -} diff --git a/dots/waybar.nix b/dots/waybar.nix index adc0f5a..e4576e2 100755 --- a/dots/waybar.nix +++ b/dots/waybar.nix @@ -10,25 +10,6 @@ programs.waybar = { enable = true; style = '' - #tags button { - padding: 0 5px; - color: #f8f8f2; - } - - #tags button.occupied { - color: inherit; - background-color: #6a548d; - } - - #tags button.focused { - color: #f8f8f2; - background-color: #aa86e1; - } - - #tags button.urgent { - color: #ea6962; - } - #mode { background: #64727D; border-bottom: 3px solid #f8f8f2; @@ -118,15 +99,14 @@ spacing = 4; # Gaps between modules (4px) # Choose the order of the modules modules-left = - if window_manager == "river" - then [ - "river/tags" - "custom/media" - ] - else if window_manager == "hyprland" + if window_manager == "hyprland" then [ "hyprland/workspaces" ] + else if window_manager == "niri" + then [ + "niri/workspaces" + ] else [ ]; modules-center = [ ]; @@ -180,20 +160,6 @@ sort-by-name = true; all-outputs = true; }; - "river/tags" = { - num-tags = 9; - tag-labels = [ - "一" - "二" - "三" - "四" - "五" - "六" - "七" - "八" - "九" - ]; - }; keyboard-state = { numlock = true; capslock = true; diff --git a/dots/xdg.nix b/dots/xdg.nix index 72091ef..f6f361d 100755 --- a/dots/xdg.nix +++ b/dots/xdg.nix @@ -16,7 +16,6 @@ config.common.default = [ "hyprland;kde" - "river" "kde" "gtk" ]; diff --git a/dots/zsh.nix b/dots/zsh.nix index 173306a..7c68ba6 100755 --- a/dots/zsh.nix +++ b/dots/zsh.nix @@ -66,7 +66,6 @@ calc = "cpc"; pdf = "mupdf"; emacs = "emacs"; - river = "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river && river"; cp = "xcp"; wget = "wget --hsts-file=$XDG_DATA_HOME/wget-hsts"; }; diff --git a/flake.lock b/flake.lock index e679cf5..0aeb555 100644 --- a/flake.lock +++ b/flake.lock @@ -814,6 +814,62 @@ "type": "github" } }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_4", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1769429762, + "narHash": "sha256-kiWNe34XXo7wneh1PzaAPBvueVbjrZ8cCLcW18EB95Y=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "6bb07820013d6164df76c658b2dfab2a634300ac", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1756556321, + "narHash": "sha256-RLD89dfjN0RVO86C/Mot0T7aduCygPGaYbog566F0Qo=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "01be0e65f4eb91a9cd624ac0b76aaeab765c7294", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.08", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1769397515, + "narHash": "sha256-VNfKIuHzNYPcaJxG+RxNgY4jK9CPf0nKovRDNFvdgAw=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "a34ed51586a8a440899396a9746eb413f05045e1", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, "nix-alien": { "inputs": { "flake-compat": "flake-compat_2", @@ -1001,6 +1057,22 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1769318308, + "narHash": "sha256-Mjx6p96Pkefks3+aA+72lu1xVehb6mv2yTUUqmSet6Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1cd347bf3355fce6c64ab37d3967b4a2cb4b878c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1769018530, @@ -1034,6 +1106,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1769170682, + "narHash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c5296fdd05cfa2c187990dd909864da9658df755", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1769170682, "narHash": "sha256-oMmN1lVQU0F0W2k6OI3bgdzp2YOHWYUAw79qzDSjenU=", @@ -1049,7 +1137,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1767767207, "narHash": "sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4=", @@ -1229,11 +1317,12 @@ "hyprland-hyprsplit": "hyprland-hyprsplit", "hyprland-plugins": "hyprland-plugins", "jovian": "jovian", + "niri": "niri", "nix-alien": "nix-alien", "nix-colors": "nix-colors", "nix-index-database": "nix-index-database_2", "nixcord": "nixcord", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "qs-qml": "qs-qml", "quickshell": "quickshell_4", "stylix": "stylix", @@ -1249,7 +1338,7 @@ "firefox-gnome-theme": "firefox-gnome-theme", "flake-parts": "flake-parts_2", "gnome-shell": "gnome-shell", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "nur": "nur", "systems": "systems_2", "tinted-foot": "tinted-foot", @@ -1424,6 +1513,39 @@ "type": "github" } }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1755491097, + "narHash": "sha256-m+9tUfsmBeF2Gn4HWa6vSITZ4Gz1eA1F5Kh62B0N4oE=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "388d291e82ffbc73be18169d39470f340707edaa", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.7", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1769356222, + "narHash": "sha256-Q0BVubV9ZnmLs506EhBSPglM+YJK56wsQNbeecvWPUo=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "cf14278b92b0a91d01587f09b4b00ea655ae24e6", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } + }, "zen-browser": { "inputs": { "home-manager": [ diff --git a/flake.nix b/flake.nix index 576d7e5..9b55522 100755 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ url = "github:kaylorben/nixcord"; inputs.nixpkgs.follows = "nixpkgs"; }; - #niri.url = "github:sodiboo/niri-flake"; + niri.url = "github:sodiboo/niri-flake"; dgop = { url = "github:AvengeMedia/dgop"; inputs.nixpkgs.follows = "nixpkgs"; @@ -78,8 +78,8 @@ allowUnfree = true; }; }; - #Avalable options are ["niri" "river" "hyprland" "all"] - window_manager = "hyprland"; + #Avalable options are ["niri" "hyprland" "all"] + window_manager = "all"; in { nixosConfigurations = { diff --git a/home/common.nix b/home/common.nix index 76701b0..fed8491 100644 --- a/home/common.nix +++ b/home/common.nix @@ -13,6 +13,7 @@ inputs.nix-colors.homeManagerModules.default inputs.stylix.homeModules.stylix inputs.nixcord.homeModules.nixcord + inputs.niri.homeModules.niri # Local modules ./sessionVars.nix @@ -26,8 +27,8 @@ ../dots/zsh.nix ../dots/nixcord.nix ../dots/xdg.nix - ../dots/river.nix ../dots/hyprland.nix + ../dots/niri.nix ../dots/hyprpaper.nix ../dots/caelestia.nix ../dots/dankMeterialShell.nix diff --git a/home/stylix.nix b/home/stylix.nix index 3a368c2..d6b7990 100755 --- a/home/stylix.nix +++ b/home/stylix.nix @@ -31,7 +31,6 @@ in #vscode.enable = true; lazygit.enable = true; #foot.enable = true; - #river.enable = true; #hyprland.enable = true; #waybar.enable = true; #nixcord.enable = true; diff --git a/result b/result index 2232c0c..d2ba45e 120000 --- a/result +++ b/result @@ -1 +1 @@ -/nix/store/0pg8p2nmvi1sw3zqgl1k5p0vqraa0kii-nixos-system-mrfluffyPC-26.05.20260123.c5296fd \ No newline at end of file +/nix/store/2xlf126vhrv4myv0jhmmdy6kd9n3s0s9-nixos-system-mrfluffyPC-26.05.20260123.c5296fd \ No newline at end of file diff --git a/system/specialisation/main-system.nix b/system/specialisation/main-system.nix index 8613446..6acb8d8 100644 --- a/system/specialisation/main-system.nix +++ b/system/specialisation/main-system.nix @@ -16,7 +16,6 @@ let # Window manager toggles wmAll = window_manager == "all"; - useRiver = window_manager == "river" || wmAll; useNiri = window_manager == "niri" || wmAll; useHypr = window_manager == "hyprland" || wmAll; in @@ -40,8 +39,6 @@ in #services.displayManager.cosmic-greeter.enable = true; # ─── Desktop / WM ─────────────────────────────────────────────────────────── - programs.river-classic.enable = useRiver; - qt = { enable = true; }; @@ -52,12 +49,8 @@ in environment.etc."/xdg/menus/applications.menu".text = builtins.readFile "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu"; - # Niri (via overlay) - #nixpkgs.overlays = [ inputs.niri.overlays.niri ]; - #programs.niri = { - # enable = useNiri; - # package = pkgs.niri-stable; # Only needed if not provided by the overlay - #}; + # Niri + programs.niri.enable = useNiri; # Hyprland programs.hyprland = {