From 0e4f1c7d13d82fad0ef11e4a98e4542f666f31dc Mon Sep 17 00:00:00 2001 From: "Simon R. - fantomitechno" Date: Thu, 28 May 2026 10:36:11 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Full=20rewrite=20of=20niri?= =?UTF-8?q?=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 15 +- home/config/codium/settings.json | 3 +- .../binds/custom_keys/function_keys.kdl | 6 + .../config/binds/custom_keys/normal_keys.kdl | 12 ++ home/niri/config/binds/default.kdl | 3 + home/niri/config/binds/utilities.kdl | 27 ++++ home/niri/config/binds/windows.kdl | 20 +++ home/niri/config/binds/workspaces.kdl | 62 +++++++++ home/niri/config/common/config.kdl | 87 ------------ home/niri/config/common/default.kdl | 18 +++ home/niri/config/common/gestures.kdl | 17 +++ home/niri/config/common/input.kdl | 119 ---------------- home/niri/config/common/layout.kdl | 24 ++++ home/niri/config/common/startup.kdl | 10 ++ home/niri/config/common/window-rules.kdl | 128 ------------------ home/niri/config/desktop.kdl | 7 + home/niri/config/input/default.kdl | 16 +++ .../{laptopfr.kdl => input/layout_fr.kdl} | 2 - .../{laptopus.kdl => input/layout_us.kdl} | 2 - home/niri/config/laptop.kdl | 7 + .../double-desktop.kdl} | 28 ---- .../laptop.kdl => monitors/single.kdl} | 11 +- home/niri/config/msi.kdl | 7 + home/niri/config/windows/browsers.kdl | 11 ++ home/niri/config/windows/code.kdl | 16 +++ home/niri/config/windows/communication.kdl | 10 ++ home/niri/config/windows/default.kdl | 42 ++++++ home/niri/config/windows/editing.kdl | 16 +++ home/niri/config/windows/games.kdl | 21 +++ home/niri/config/windows/utilities.kdl | 25 ++++ home/niri/default.nix | 8 +- hosts/common/configuration.nix | 3 - hosts/common/packages.nix | 1 + 33 files changed, 391 insertions(+), 393 deletions(-) create mode 100644 home/niri/config/binds/custom_keys/function_keys.kdl create mode 100644 home/niri/config/binds/custom_keys/normal_keys.kdl create mode 100644 home/niri/config/binds/default.kdl create mode 100644 home/niri/config/binds/utilities.kdl create mode 100644 home/niri/config/binds/windows.kdl create mode 100644 home/niri/config/binds/workspaces.kdl delete mode 100644 home/niri/config/common/config.kdl create mode 100644 home/niri/config/common/default.kdl create mode 100644 home/niri/config/common/gestures.kdl delete mode 100644 home/niri/config/common/input.kdl create mode 100644 home/niri/config/common/layout.kdl create mode 100644 home/niri/config/common/startup.kdl delete mode 100644 home/niri/config/common/window-rules.kdl create mode 100644 home/niri/config/desktop.kdl create mode 100644 home/niri/config/input/default.kdl rename home/niri/config/{laptopfr.kdl => input/layout_fr.kdl} (73%) rename home/niri/config/{laptopus.kdl => input/layout_us.kdl} (78%) create mode 100644 home/niri/config/laptop.kdl rename home/niri/config/{desktopfr.kdl => monitors/double-desktop.kdl} (52%) rename home/niri/config/{common/laptop.kdl => monitors/single.kdl} (51%) create mode 100644 home/niri/config/msi.kdl create mode 100644 home/niri/config/windows/browsers.kdl create mode 100644 home/niri/config/windows/code.kdl create mode 100644 home/niri/config/windows/communication.kdl create mode 100644 home/niri/config/windows/default.kdl create mode 100644 home/niri/config/windows/editing.kdl create mode 100644 home/niri/config/windows/games.kdl create mode 100644 home/niri/config/windows/utilities.kdl diff --git a/flake.nix b/flake.nix index ec6445a..21a605e 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,7 @@ in { nixosConfigurations = { - laptop = nixpkgs.lib.nixosSystem { + fantomitechno-laptop = nixpkgs.lib.nixosSystem { inherit system; modules = [ { @@ -39,16 +39,15 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { - type = "laptop"; - kb = "us"; inherit niri-float-sticky; + hostname = "laptop"; }; home-manager.users."fantomitechno" = import ./home; } minegrub-theme.nixosModules.default ]; }; - desktop = nixpkgs.lib.nixosSystem { + fantomitechno-desktop = nixpkgs.lib.nixosSystem { inherit system; modules = [ { @@ -61,15 +60,14 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { - type = "desktop"; - kb = "fr"; inherit niri-float-sticky; + hostname = "desktop"; }; home-manager.users."fantomitechno" = import ./home; } ]; }; - msi = nixpkgs.lib.nixosSystem { + fantomitechno-msi = nixpkgs.lib.nixosSystem { inherit system; modules = [ { @@ -82,9 +80,8 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { - type = "laptop"; - kb = "fr"; inherit niri-float-sticky; + hostname = "msi"; }; home-manager.users."fantomitechno" = import ./home; } diff --git a/home/config/codium/settings.json b/home/config/codium/settings.json index 06decac..9b63e77 100644 --- a/home/config/codium/settings.json +++ b/home/config/codium/settings.json @@ -36,5 +36,6 @@ "js/ts.updateImportsOnFileMove.enabled": "always", "vs-code-prettier-eslint.prettierLast": true, "diffEditor.ignoreTrimWhitespace": false, - "nix.serverPath": "nil" + "nix.serverPath": "nil", + "workbench.startupEditor": "none" } \ No newline at end of file diff --git a/home/niri/config/binds/custom_keys/function_keys.kdl b/home/niri/config/binds/custom_keys/function_keys.kdl new file mode 100644 index 0000000..ade5506 --- /dev/null +++ b/home/niri/config/binds/custom_keys/function_keys.kdl @@ -0,0 +1,6 @@ +binds { + F9 allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } + F10 allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } + F11 allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; } + F12 allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; } +} diff --git a/home/niri/config/binds/custom_keys/normal_keys.kdl b/home/niri/config/binds/custom_keys/normal_keys.kdl new file mode 100644 index 0000000..c3d81b6 --- /dev/null +++ b/home/niri/config/binds/custom_keys/normal_keys.kdl @@ -0,0 +1,12 @@ +binds { + XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; } + XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } + XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } + + // Media control keys using playerctl + XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; } + XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; } + XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; } + XF86AudioStop allow-when-locked=true { spawn-sh "playerctl stop"; } +} \ No newline at end of file diff --git a/home/niri/config/binds/default.kdl b/home/niri/config/binds/default.kdl new file mode 100644 index 0000000..a7e1bc7 --- /dev/null +++ b/home/niri/config/binds/default.kdl @@ -0,0 +1,3 @@ +include "utilities.kdl" +include "windows.kdl" +include "workspaces.kdl" diff --git a/home/niri/config/binds/utilities.kdl b/home/niri/config/binds/utilities.kdl new file mode 100644 index 0000000..0d19109 --- /dev/null +++ b/home/niri/config/binds/utilities.kdl @@ -0,0 +1,27 @@ +binds { + Mod+Shift+Comma { show-hotkey-overlay; } + Mod+Shift+O hotkey-overlay-title="toggle opacity" { toggle-window-rule-opacity; } + + Mod+W hotkey-overlay-title="toggle waybar" repeat=false { spawn-sh "pkill waybar || waybar"; } + Mod+Shift+W hotkey-overlay-title="random wallpaper" { spawn-sh "waypaper --random"; } + + Mod+A hotkey-overlay-title="Run an Application" { spawn-sh "wofi --show drun"; } + Super+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn-sh "swaylock "; } + + Mod+TAB repeat=false { toggle-overview; } + Mod+Shift+TAB repeat=false { spawn "~/.local/bin/nws.sh"; } + Mod+Shift+P repeat=false { spawn-sh "wl-mirror $(niri msg --json focused-output | jq -r .name)"; } + + Mod+Q repeat=false { close-window; } + + Mod+V { spawn-sh "cliphist list | wofi -S dmenu | cliphist decode | wl-copy"; } + + + Print { screenshot; } + Ctrl+Print { screenshot-screen; } + Alt+Print { screenshot-window; } + + Mod+Shift+E { quit; } + Ctrl+Alt+Delete { quit; } + Mod+Escape { spawn-sh "wlogout"; } +} \ No newline at end of file diff --git a/home/niri/config/binds/windows.kdl b/home/niri/config/binds/windows.kdl new file mode 100644 index 0000000..0bfbea2 --- /dev/null +++ b/home/niri/config/binds/windows.kdl @@ -0,0 +1,20 @@ +binds { + // Code + Mod+T hotkey-overlay-title="Open a Terminal " { spawn "kitty"; } + Mod+C hotkey-overlay-title="Open a Text Editor " { spawn "codium"; } + Mod+I hotkey-overlay-title="Open a Text Editor " { spawn "idea-oss"; } + + // Utility + Mod+E hotkey-overlay-title="Open a FileManager " { spawn "nautilus"; } + Mod+B hotkey-overlay-title="Open a Browser " { spawn "brave"; } + Mod+Return hotkey-overlay-title="Open Calculator " { spawn "gnome-calculator"; } + + // Communication + Mod+D hotkey-overlay-title="Open a Browser " { spawn-sh "vesktop --enable-blink-features=MiddleClickAutoscroll"; } + + // Music + Mod+M hotkey-overlay-title="Open Tidal " { spawn "tidal-hifi"; } + + // Games + Mod+S hotkey-overlay-title="Open Steam " { spawn "steam"; } +} \ No newline at end of file diff --git a/home/niri/config/binds/workspaces.kdl b/home/niri/config/binds/workspaces.kdl new file mode 100644 index 0000000..3335ec0 --- /dev/null +++ b/home/niri/config/binds/workspaces.kdl @@ -0,0 +1,62 @@ +binds { + // LEFT + Mod+Left { focus-column-left; } + Mod+Shift+WheelScrollUp cooldown-ms=150 { focus-column-left; } + + Mod+Ctrl+Left { move-column-left; } + + Mod+O { focus-monitor-left; } + + Mod+Alt+Left { consume-or-expel-window-left; } + + // RIGHT + Mod+Right { focus-column-right; } + Mod+Shift+WheelScrollDown cooldown-ms=150 { focus-column-right; } + + Mod+Ctrl+Right { move-column-right; } + + Mod+P { focus-monitor-right; } + + Mod+Alt+Right { consume-or-expel-window-right; } + + // DOWN + Mod+Page_Down { focus-workspace-down; } + + Mod+Down { focus-window-or-workspace-down; } + Mod+WheelScrollDown cooldown-ms=150 { focus-window-or-workspace-down; } + + Mod+Ctrl+Down { move-window-down-or-to-workspace-down; } + Mod+Ctrl+WheelScrollDown { move-window-down-or-to-workspace-down; } + + Mod+Ctrl+Page_Down { move-column-to-workspace-down; } + + // UP + Mod+Page_Up { focus-workspace-up; } + + Mod+Up { focus-window-or-workspace-up; } + Mod+WheelScrollUp cooldown-ms=150 { focus-window-or-workspace-up; } + + Mod+Ctrl+Up { move-window-up-or-to-workspace-up; } + Mod+Ctrl+WheelScrollUp { move-window-up-or-to-workspace-up; } + + Mod+Ctrl+Page_Up { move-column-to-workspace-up; } + + + Mod+Alt+Down { consume-window-into-column; } + Mod+Alt+Up { expel-window-from-column; } + + Mod+R { switch-preset-column-width; } + Mod+Ctrl+R { reset-window-height; } + + Mod+F { maximize-column; } + Mod+Shift+F { fullscreen-window; } + Mod+Ctrl+F { expand-column-to-available-width; } + + + Mod+Shift+Equal { set-column-width "-10%"; } + Mod+Equal { set-column-width "+10%"; } + Mod+Ctrl+Shift+Equal { set-column-width "-5%"; } + Mod+Ctrl+Equal { set-column-width "+5%"; } + + Mod+Shift+V { toggle-window-floating; } +} \ No newline at end of file diff --git a/home/niri/config/common/config.kdl b/home/niri/config/common/config.kdl deleted file mode 100644 index dc701cb..0000000 --- a/home/niri/config/common/config.kdl +++ /dev/null @@ -1,87 +0,0 @@ -include "input.kdl" -include "window-rules.kdl" - -input { - keyboard { - numlock - } - touchpad { - tap - // disabled-on-external-mouse - } - - mouse { - } - trackpoint { - off - } - warp-mouse-to-focus - focus-follows-mouse max-scroll-amount="15%" -} - -overview { - zoom 0.25 -} - -layout { - // Set gaps around windows in logical pixels. - gaps 5 - - focus-ring { - // off - width 1 - - // active-color "#7fc8ff" - // inactive-color "#505050" - - active-gradient from="#d06005" to="#9a09ba" angle=45 - 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 { - off - } - - // You can enable drop shadows for windows. - shadow { - on - draw-behind-window true - softness 50 - spread 5 - offset x=0 y=5 - color "#0007" - } - background-color "transparent" -} - -hotkey-overlay { - skip-at-startup -} - -screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" - -animations { - // off -} - -spawn-at-startup "waybar" -spawn-sh-at-startup "nm-applet --indicator" -spawn-sh-at-startup "tailscale systray" -spawn-sh-at-startup "sunsetr" -spawn-sh-at-startup "udiskie" -spawn-sh-at-startup "wl-paste --watch cliphist store" -spawn-sh-at-startup "blueman-applet" -spawn-sh-at-startup "waypaper --random" -spawn-sh-at-startup "swayidle -w timeout 900 'swaylock -f' timeout 900 'niri msg output power off' resume 'niri msg output power on' before-sleep 'swaylock -f'" -spawn-at-startup "niri-float-sticky" - -layer-rule { - place-within-backdrop true -} - -gestures { - hot-corners { - off - } -} \ No newline at end of file diff --git a/home/niri/config/common/default.kdl b/home/niri/config/common/default.kdl new file mode 100644 index 0000000..2f08d12 --- /dev/null +++ b/home/niri/config/common/default.kdl @@ -0,0 +1,18 @@ +include "gestures.kdl" +include "layout.kdl" +include "startup.kdl" + + +overview { + zoom 0.25 +} + +hotkey-overlay { + skip-at-startup +} + +screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" + +layer-rule { + place-within-backdrop true +} \ No newline at end of file diff --git a/home/niri/config/common/gestures.kdl b/home/niri/config/common/gestures.kdl new file mode 100644 index 0000000..cb927bf --- /dev/null +++ b/home/niri/config/common/gestures.kdl @@ -0,0 +1,17 @@ +gestures { + hot-corners { + off + } + + dnd-edge-view-scroll { + trigger-width 30 + delay-ms 100 + max-speed 15000 + } + + dnd-edge-workspace-switch { + trigger-height 50 + delay-ms 100 + max-speed 15000 + } +} \ No newline at end of file diff --git a/home/niri/config/common/input.kdl b/home/niri/config/common/input.kdl deleted file mode 100644 index 83560bf..0000000 --- a/home/niri/config/common/input.kdl +++ /dev/null @@ -1,119 +0,0 @@ -binds { - Mod+Shift+Comma { show-hotkey-overlay; } - Mod+Shift+O hotkey-overlay-title="toggle opacity" { toggle-window-rule-opacity; } - Mod+Shift+W hotkey-overlay-title="random wallpaper" { spawn-sh "waypaper --random"; } - - Mod+W hotkey-overlay-title="toggle waybar" repeat=false { spawn-sh "pkill waybar || waybar"; } - - // Suggested binds for running programs: terminal, app launcher, screen locker. - Mod+T hotkey-overlay-title="Open a Terminal " { spawn "kitty"; } - Mod+B hotkey-overlay-title="Open a Browser " { spawn "brave"; } - Mod+D hotkey-overlay-title="Open a Browser " { spawn-sh "vesktop --enable-blink-features=MiddleClickAutoscroll"; } - Mod+E hotkey-overlay-title="Open a FileManager " { spawn "nautilus"; } - Mod+M hotkey-overlay-title="Open Tidal " { spawn "tidal-hifi"; } - Mod+C hotkey-overlay-title="Open a Text Editor " { spawn "codium"; } - Mod+I hotkey-overlay-title="Open a Text Editor " { spawn "idea-oss"; } - Mod+S hotkey-overlay-title="Open Steam " { spawn "steam"; } - Mod+Return hotkey-overlay-title="Open Calculator " { spawn "gnome-calculator"; } - - Mod+A hotkey-overlay-title="Run an Application" { spawn-sh "wofi --show drun"; } - Super+L hotkey-overlay-title="Lock the Screen: swaylock" { spawn-sh "swaylock "; } - - // Example volume keys mappings for PipeWire & WirePlumber. - // The allow-when-locked=true property makes them work even when the session is locked. - // Using spawn-sh allows to pass multiple arguments together with the command. - XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; } - XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; } - XF86AudioMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } - XF86AudioMicMute allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } - F12 allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+"; } - F11 allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05-"; } - F10 allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; } - F9 allow-when-locked=true { spawn-sh "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; } - - // Media control keys using playerctl - XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; } - XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; } - XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; } - XF86AudioStop allow-when-locked=true { spawn-sh "playerctl stop"; } - - // XF86MonBrightnessUp allow-when-locked=true { spawn-sh "sunsetr set night_gamma+=5"; } - // XF86MonBrightnessDown allow-when-locked=true { spawn-sh "sunsetr set night_gamma-=5"; } - - Mod+TAB repeat=false { toggle-overview; } - Mod+Shift+TAB repeat=false { spawn "~/.local/bin/nws.sh"; } - Mod+Shift+P repeat=false { spawn-sh "wl-mirror $(niri msg --json focused-output | jq -r .name)"; } - - Mod+Q repeat=false { close-window; } - - Mod+Left { focus-column-left; } - Mod+Down { focus-window-or-workspace-down; } - Mod+Up { focus-window-or-workspace-up; } - Mod+WheelScrollDown cooldown-ms=150 { focus-window-or-workspace-down; } - Mod+WheelScrollUp cooldown-ms=150 { focus-window-or-workspace-up; } - Mod+Right { focus-column-right; } - Mod+Shift+WheelScrollDown cooldown-ms=150 { focus-column-right; } - Mod+Shift+WheelScrollUp cooldown-ms=150 { focus-column-left; } - Mod+O { focus-monitor-left; } - Mod+P { focus-monitor-right; } - - Mod+Ctrl+Left { move-column-left; } - Mod+Ctrl+Down { move-window-down-or-to-workspace-down; } - Mod+Ctrl+Up { move-window-up-or-to-workspace-up; } - Mod+Ctrl+WheelScrollDown { move-window-down-or-to-workspace-down; } - Mod+Ctrl+WheelScrollUp { move-window-up-or-to-workspace-up; } - Mod+Ctrl+Right { move-column-right; } - - Mod+Page_Down { focus-workspace-down; } - Mod+Page_Up { focus-workspace-up; } - Mod+Ctrl+Page_Down { move-column-to-workspace-down; } - Mod+Ctrl+Page_Up { move-column-to-workspace-up; } - - // The following binds move the focused window in and out of a column. - // If the window is alone, they will consume it into the nearby column to the side. - // If the window is already in a column, they will expel it out. - Mod+Alt+Left { consume-or-expel-window-left; } - Mod+Alt+Right { consume-or-expel-window-right; } - Mod+Alt+Down { consume-window-into-column; } - Mod+Alt+Up { expel-window-from-column; } - - Mod+R { switch-preset-column-width; } - // Cycling through the presets in reverse order is also possible. - // Mod+R { switch-preset-column-width-back; } - // Mod+Shift+R { switch-preset-window-height; } - Mod+Ctrl+R { reset-window-height; } - Mod+F { maximize-column; } - Mod+Shift+F { fullscreen-window; } - - // Expand the focused column to space not taken up by other fully visible columns. - // Makes the column "fill the rest of the space". - Mod+Ctrl+F { expand-column-to-available-width; } - - Mod+Shift+C { center-column; } - - Mod+Shift+Equal { set-column-width "-10%"; } - Mod+Equal { set-column-width "+10%"; } - Mod+Ctrl+Shift+Equal { set-column-width "-5%"; } - Mod+Ctrl+Equal { set-column-width "+5%"; } - - Mod+Shift+V { toggle-window-floating; } - Mod+V { spawn-sh "cliphist list | wofi -S dmenu | cliphist decode | wl-copy"; } - - Print { screenshot; } - Ctrl+Print { screenshot-screen; } - Alt+Print { screenshot-window; } - - // Applications such as remote-desktop clients and software KVM switches may - // request that niri stops processing the keyboard shortcuts defined here - // so they may, for example, forward the key presses as-is to a remote machine. - // It's a good idea to bind an escape hatch to toggle the inhibitor, - // so a buggy application can't hold your session hostage. - // - // The allow-inhibiting=false property can be applied to other binds as well, - // which ensures niri always processes them, even when an inhibitor is active. - // Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } - - Mod+Shift+E { quit; } - Ctrl+Alt+Delete { quit; } - Mod+Escape { spawn-sh "wlogout"; } -} \ No newline at end of file diff --git a/home/niri/config/common/layout.kdl b/home/niri/config/common/layout.kdl new file mode 100644 index 0000000..40a3280 --- /dev/null +++ b/home/niri/config/common/layout.kdl @@ -0,0 +1,24 @@ +layout { + gaps 5 + + focus-ring { + width 1 + + active-gradient from="#d06005" to="#9a09ba" angle=45 + inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" + } + + border { + off + } + + shadow { + on + draw-behind-window true + softness 50 + spread 5 + offset x=0 y=5 + color "#0007" + } + background-color "transparent" +} \ No newline at end of file diff --git a/home/niri/config/common/startup.kdl b/home/niri/config/common/startup.kdl new file mode 100644 index 0000000..6ad56cb --- /dev/null +++ b/home/niri/config/common/startup.kdl @@ -0,0 +1,10 @@ +spawn-at-startup "waybar" +spawn-sh-at-startup "nm-applet --indicator" +spawn-sh-at-startup "tailscale systray" +spawn-sh-at-startup "sunsetr" +spawn-sh-at-startup "udiskie" +spawn-sh-at-startup "wl-paste --watch cliphist store" +spawn-sh-at-startup "blueman-applet" +spawn-sh-at-startup "waypaper --random" +spawn-sh-at-startup "swayidle -w timeout 900 'swaylock -f' timeout 900 'niri msg output power off' resume 'niri msg output power on' before-sleep 'swaylock -f'" +spawn-at-startup "niri-float-sticky" \ No newline at end of file diff --git a/home/niri/config/common/window-rules.kdl b/home/niri/config/common/window-rules.kdl deleted file mode 100644 index e552efa..0000000 --- a/home/niri/config/common/window-rules.kdl +++ /dev/null @@ -1,128 +0,0 @@ -window-rule { - match title="Picture in picture" - open-floating true - open-focused false - default-floating-position x=100 y=100 relative-to="bottom-right" - tiled-state true -} - -window-rule { - match app-id=r#"obs"# - open-on-workspace "obs" - open-maximized true -} - -window-rule { - match app-id=r#"[Mm]inecraft"# - open-maximized true -} - -window-rule { - match app-id=r#"steam"# - open-on-workspace "stm" -} - -window-rule { - match app-id=r#"[Cc]eleste"# - open-on-workspace "stm" - open-maximized true - open-fullscreen true -} - -window-rule { - match app-id="love" - open-on-workspace "stm" -} - -window-rule { - match app-id=r#"^vesktop$"# - open-on-workspace "dsc" - open-maximized true -} - -window-rule { - match title=r".*Microsoft Teams" - open-on-workspace "dsc" -} - -window-rule { - match app-id=r#"brave"# - open-maximized true - open-on-workspace "brow" -} - -window-rule { - match app-id=r#"firefox"# - open-maximized true - open-on-workspace "brow" -} - -window-rule { - match app-id="codium" - open-maximized true -} - -window-rule { - match app-id="jetbrains-idea" - open-maximized true -} - -window-rule { - match app-id=r#"kitty"# - open-maximized true - opacity 0.65 - open-on-workspace "term" -} - -window-rule { - match app-id="nm-connection-editor" - open-floating true - default-floating-position x=660 y=335 -} - -window-rule { - match app-id="org.pulseaudio.pavucontrol" - open-floating true - default-column-width { fixed 702; } - default-window-height { fixed 496; } -} - -window-rule { - geometry-corner-radius 6 - clip-to-geometry true -} - -window-rule { - match app-id="org.gnome.Calculator" - open-floating true - default-column-width { fixed 360; } - default-window-height { fixed 616; } -} - -window-rule { - match app-id="vlc" - open-maximized true -} - -// Indicate screencasted windows with red colors. -window-rule { - match is-window-cast-target=true - - focus-ring { - active-color "#f38ba8" - inactive-color "#7d0d2d" - } - - border { - inactive-color "#7d0d2d" - } - - shadow { - color "#7d0d2d70" - } - - tab-indicator { - active-color "#f38ba8" - inactive-color "#7d0d2d" - } -} \ No newline at end of file diff --git a/home/niri/config/desktop.kdl b/home/niri/config/desktop.kdl new file mode 100644 index 0000000..7d01bb0 --- /dev/null +++ b/home/niri/config/desktop.kdl @@ -0,0 +1,7 @@ +include "configs/binds/default.kdl" +include "configs/binds/custom_keys/function_keys.kdl" +include "configs/common/default.kdl" +include "configs/input/default.kdl" +include "configs/input/layout_fr.kdl" +include "configs/monitors/double.kdl" +include "configs/windows/default.kdl" \ No newline at end of file diff --git a/home/niri/config/input/default.kdl b/home/niri/config/input/default.kdl new file mode 100644 index 0000000..b707ff9 --- /dev/null +++ b/home/niri/config/input/default.kdl @@ -0,0 +1,16 @@ +input { + keyboard { + numlock + } + + touchpad { + tap + } + + trackpoint { + off + } + + warp-mouse-to-focus + focus-follows-mouse max-scroll-amount="20%" +} \ No newline at end of file diff --git a/home/niri/config/laptopfr.kdl b/home/niri/config/input/layout_fr.kdl similarity index 73% rename from home/niri/config/laptopfr.kdl rename to home/niri/config/input/layout_fr.kdl index 95bb3be..775bae9 100644 --- a/home/niri/config/laptopfr.kdl +++ b/home/niri/config/input/layout_fr.kdl @@ -1,5 +1,3 @@ -include "common/laptop.kdl" - input { keyboard { xkb { diff --git a/home/niri/config/laptopus.kdl b/home/niri/config/input/layout_us.kdl similarity index 78% rename from home/niri/config/laptopus.kdl rename to home/niri/config/input/layout_us.kdl index 6113b4e..3eba399 100644 --- a/home/niri/config/laptopus.kdl +++ b/home/niri/config/input/layout_us.kdl @@ -1,5 +1,3 @@ -include "common/laptop.kdl" - input { keyboard { xkb { diff --git a/home/niri/config/laptop.kdl b/home/niri/config/laptop.kdl new file mode 100644 index 0000000..08bab5e --- /dev/null +++ b/home/niri/config/laptop.kdl @@ -0,0 +1,7 @@ +include "configs/binds/default.kdl" +include "configs/binds/custom_keys/normal_keys.kdl" +include "configs/common/default.kdl" +include "configs/input/default.kdl" +include "configs/input/layout_us.kdl" +include "configs/monitors/single.kdl" +include "configs/windows/default.kdl" \ No newline at end of file diff --git a/home/niri/config/desktopfr.kdl b/home/niri/config/monitors/double-desktop.kdl similarity index 52% rename from home/niri/config/desktopfr.kdl rename to home/niri/config/monitors/double-desktop.kdl index 544f433..a1b366c 100644 --- a/home/niri/config/desktopfr.kdl +++ b/home/niri/config/monitors/double-desktop.kdl @@ -1,20 +1,3 @@ -include "common/config.kdl" - - -input { - keyboard { - xkb { - layout "fr,us" - } - } -} - -output "HDMI-A-1" { - mode "1920x1080@60.000" - scale 1 - position x=-1920 y=-60 -} - output "DP-1" { mode "1920x1080@74.973" scale 1 @@ -44,15 +27,4 @@ workspace "other" { workspace "edit" { open-on-output "DP-1" -} - -window-rule { - match app-id="kdenlive" - open-on-workspace "edit" - open-maximized true -} - -window-rule { - match app-id="Audacity" - open-on-workspace "edit" } \ No newline at end of file diff --git a/home/niri/config/common/laptop.kdl b/home/niri/config/monitors/single.kdl similarity index 51% rename from home/niri/config/common/laptop.kdl rename to home/niri/config/monitors/single.kdl index bca54c5..e106cb7 100644 --- a/home/niri/config/common/laptop.kdl +++ b/home/niri/config/monitors/single.kdl @@ -1,5 +1,3 @@ -include "config.kdl" - output "eDP-1" { mode "1920x1080@60.049" scale 1 @@ -10,10 +8,5 @@ workspace "brow" workspace "term" workspace "stm" workspace "obs" -workspace "other" - - -//window-rule { -// match app-id="at.yrlf.wl_mirror" -// open-on-output="HDMI-A-1" -//} +workspace "edit" +workspace "other" \ No newline at end of file diff --git a/home/niri/config/msi.kdl b/home/niri/config/msi.kdl new file mode 100644 index 0000000..919a457 --- /dev/null +++ b/home/niri/config/msi.kdl @@ -0,0 +1,7 @@ +include "configs/binds/default.kdl" +include "configs/binds/custom_keys/function_keys.kdl" +include "configs/common/default.kdl" +include "configs/input/default.kdl" +include "configs/input/layout_fr.kdl" +include "configs/monitors/single.kdl" +include "configs/windows/default.kdl" \ No newline at end of file diff --git a/home/niri/config/windows/browsers.kdl b/home/niri/config/windows/browsers.kdl new file mode 100644 index 0000000..83f9585 --- /dev/null +++ b/home/niri/config/windows/browsers.kdl @@ -0,0 +1,11 @@ +window-rule { + match app-id=r#"brave"# + open-maximized true + open-on-workspace "brow" +} + +window-rule { + match app-id=r#"firefox"# + open-maximized true + open-on-workspace "brow" +} \ No newline at end of file diff --git a/home/niri/config/windows/code.kdl b/home/niri/config/windows/code.kdl new file mode 100644 index 0000000..f0518e3 --- /dev/null +++ b/home/niri/config/windows/code.kdl @@ -0,0 +1,16 @@ +window-rule { + match app-id="codium" + open-maximized true +} + +window-rule { + match app-id="jetbrains-idea" + open-maximized true +} + +window-rule { + match app-id=r#"kitty"# + open-maximized true + opacity 0.65 + open-on-workspace "term" +} \ No newline at end of file diff --git a/home/niri/config/windows/communication.kdl b/home/niri/config/windows/communication.kdl new file mode 100644 index 0000000..3bc05f0 --- /dev/null +++ b/home/niri/config/windows/communication.kdl @@ -0,0 +1,10 @@ +window-rule { + match app-id=r#"^vesktop$"# + open-on-workspace "dsc" + open-maximized true +} + +window-rule { + match title=r".*Microsoft Teams" + open-on-workspace "dsc" +} \ No newline at end of file diff --git a/home/niri/config/windows/default.kdl b/home/niri/config/windows/default.kdl new file mode 100644 index 0000000..16be096 --- /dev/null +++ b/home/niri/config/windows/default.kdl @@ -0,0 +1,42 @@ +include "browsers.kdl" +include "code.kdl" +include "communication.kdl" +include "editing.kdl" +include "games.kdl" +include "utilities.kdl" + +window-rule { + geometry-corner-radius 6 + clip-to-geometry true +} + +// Indicate screencasted windows with red colors. +window-rule { + match is-window-cast-target=true + + focus-ring { + active-color "#f38ba8" + inactive-color "#7d0d2d" + } + + border { + inactive-color "#7d0d2d" + } + + shadow { + color "#7d0d2d70" + } + + tab-indicator { + active-color "#f38ba8" + inactive-color "#7d0d2d" + } +} + +window-rule { + match title="Picture in picture" + open-floating true + open-focused false + default-floating-position x=100 y=100 relative-to="bottom-right" + tiled-state true +} \ No newline at end of file diff --git a/home/niri/config/windows/editing.kdl b/home/niri/config/windows/editing.kdl new file mode 100644 index 0000000..5a35755 --- /dev/null +++ b/home/niri/config/windows/editing.kdl @@ -0,0 +1,16 @@ +window-rule { + match app-id="kdenlive" + open-on-workspace "edit" + open-maximized true +} + +window-rule { + match app-id="Audacity" + open-on-workspace "edit" +} + +window-rule { + match app-id=r#"obs"# + open-on-workspace "obs" + open-maximized true +} \ No newline at end of file diff --git a/home/niri/config/windows/games.kdl b/home/niri/config/windows/games.kdl new file mode 100644 index 0000000..c52d267 --- /dev/null +++ b/home/niri/config/windows/games.kdl @@ -0,0 +1,21 @@ +window-rule { + match app-id=r#"[Mm]inecraft"# + open-maximized true +} + +window-rule { + match app-id=r#"steam"# + open-on-workspace "stm" +} + +window-rule { + match app-id=r#"[Cc]eleste"# + open-on-workspace "stm" + open-maximized true + open-fullscreen true +} + +window-rule { + match app-id="love" + open-on-workspace "stm" +} diff --git a/home/niri/config/windows/utilities.kdl b/home/niri/config/windows/utilities.kdl new file mode 100644 index 0000000..ea032c6 --- /dev/null +++ b/home/niri/config/windows/utilities.kdl @@ -0,0 +1,25 @@ +window-rule { + match app-id="nm-connection-editor" + open-floating true + default-floating-position x=660 y=335 +} + +window-rule { + match app-id="org.pulseaudio.pavucontrol" + open-floating true + default-column-width { fixed 702; } + default-window-height { fixed 496; } +} + + +window-rule { + match app-id="org.gnome.Calculator" + open-floating true + default-column-width { fixed 360; } + default-window-height { fixed 616; } +} + +window-rule { + match app-id="vlc" + open-maximized true +} \ No newline at end of file diff --git a/home/niri/default.nix b/home/niri/default.nix index 8bb2bad..b4c0ac3 100644 --- a/home/niri/default.nix +++ b/home/niri/default.nix @@ -1,7 +1,6 @@ { config, - type, - kb, + hostname, ... }: let @@ -9,10 +8,9 @@ let niriFolder = "${dotfileFolder}/home/niri"; in { + xdg.configFile."niri/configs".source = config.lib.file.mkOutOfStoreSymlink "${niriFolder}/config"; xdg.configFile."niri/config.kdl".source = - config.lib.file.mkOutOfStoreSymlink "${niriFolder}/config/${type}${kb}.kdl"; - xdg.configFile."niri/common".source = - config.lib.file.mkOutOfStoreSymlink "${niriFolder}/config/common"; + config.lib.file.mkOutOfStoreSymlink "${niriFolder}/config/${hostname}.kdl"; xdg.configFile."swaylock/config".source = config.lib.file.mkOutOfStoreSymlink "${niriFolder}/swaylock.conf"; diff --git a/hosts/common/configuration.nix b/hosts/common/configuration.nix index 2d1ba5b..fb2ea9d 100644 --- a/hosts/common/configuration.nix +++ b/hosts/common/configuration.nix @@ -36,9 +36,6 @@ "wireshark" "docker" ]; - packages = with pkgs; [ - brave - ]; shell = pkgs.zsh; }; diff --git a/hosts/common/packages.nix b/hosts/common/packages.nix index 55ae760..00ec742 100644 --- a/hosts/common/packages.nix +++ b/hosts/common/packages.nix @@ -74,6 +74,7 @@ # apps archipelago bitwarden-desktop + brave file-roller gnome-calculator jetbrains.idea-oss -- 2.54.0