diff --git a/modules/home/home.nix b/modules/home/home.nix index 47b18cf..d88e11b 100755 --- a/modules/home/home.nix +++ b/modules/home/home.nix @@ -1,7 +1,7 @@ { pkgs, ... }: { imports = [ - ./hyprland.nix + ./niri.nix ]; home.packages = [ diff --git a/modules/home/niri.nix b/modules/home/niri.nix new file mode 100644 index 0000000..1ee10d3 --- /dev/null +++ b/modules/home/niri.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + xdg.configFile."niri/config.kdl".source = ./niri/config.kdl; +} diff --git a/modules/home/niri/config.kdl b/modules/home/niri/config.kdl new file mode 100644 index 0000000..f222c86 --- /dev/null +++ b/modules/home/niri/config.kdl @@ -0,0 +1,222 @@ +// from hyprland + +input { + keyboard { + xkb { + layout "tr" + } + repeat-delay 250 + repeat-rate 35 + } + + mouse { + accel-speed -0.5 + accel-profile "adaptive" + } + + touchpad { + tap + natural-scroll + disabled-on-typing + scroll-factor 0.5 + click-method "clickfinger" + } + + focus-follows-mouse + warp-mouse-to-focus +} + +cursor { + theme "Bibata-Modern-Classic" + size 24 +} + +environment { + XCURSOR_THEME "Bibata-Modern-Classic" + XCURSOR_SIZE "24" + QT_STYLE_OVERRIDE "adwaita-dark" + GDK_BACKEND "wayland,x11" + QT_QPA_PLATFORM "wayland;xcb" + QT_QPA_PLATFORMTHEME "gtk3" + ELECTRON_OZONE_PLATFORM_HINT "auto" + TERMINAL "ghostty" + MESA_GL_VERSION_OVERRIDE "4.6" + MESA_GLSL_VERSION_OVERRIDE "460" + DISPLAY ":0" +} + +spawn-at-startup "xwayland-satellite" +spawn-at-startup "noctalia-shell" +spawn-at-startup "sh" "-c" "wl-paste --type text --watch cliphist store" +spawn-at-startup "sh" "-c" "wl-paste --type image --watch cliphist store" + +prefer-no-csd + +screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" + +layout { + gaps 5 + + struts { + left 7 + right 7 + top 7 + bottom 7 + } + + center-focused-column "never" + + preset-column-widths { + proportion 0.33333 + proportion 0.5 + proportion 0.66667 + } + + default-column-width { proportion 0.5; } + + focus-ring { + width 2 + active-color "#61afef" + inactive-color "#444444" + } + + border { + off + } +} + +animations { + slowdown 0.8 +} + +binds { + // workspace navigation + Ctrl+Mod+Right { focus-workspace-down; } + Ctrl+Mod+Left { focus-workspace-up; } + Ctrl+Mod+Down { focus-workspace-down; } + Ctrl+Mod+Up { focus-workspace-up; } + + Ctrl+Mod+Shift+Right { move-window-to-workspace-down; } + Ctrl+Mod+Shift+Left { move-window-to-workspace-up; } + Ctrl+Mod+Shift+Down { move-window-to-workspace-down; } + Ctrl+Mod+Shift+Up { move-window-to-workspace-up; } + + // interface + Mod+Space { spawn "noctalia-shell" "ipc" "call" "launcher" "toggle"; } + Mod+P { spawn "noctalia-shell" "ipc" "call" "bar" "toggle"; } + Mod+Tab { toggle-overview; } + Ctrl+Alt+Delete { spawn "noctalia-shell" "ipc" "call" "sessionMenu" "toggle"; } + + // noctalia plugins + Mod+Shift+S { spawn "noctalia-shell" "ipc" "call" "plugin:screen-shot-and-record" "screenshot"; } + Mod+Shift+Z { spawn "noctalia-shell" "ipc" "call" "plugin:screen-shot-and-record" "search"; } + Mod+Shift+X { spawn "noctalia-shell" "ipc" "call" "plugin:screen-shot-and-record" "ocr"; } + Mod+Shift+C { spawn "noctalia-shell" "ipc" "call" "plugin:music" "panel"; } + + // launchers + Mod+Return { spawn "ghostty"; } + Mod+W { spawn "zen-beta"; } + Mod+E { spawn "dolphin"; } + Mod+Z { spawn "code"; } + Mod+Alt+V { spawn "pavucontrol"; } + Mod+Shift+V { spawn "noctalia-shell" "ipc" "call" "launcher" "clipboard"; } + Mod+Shift+L { spawn "noctalia-shell" "ipc" "call" "lockScreen" "lock"; } + Ctrl+Shift+Escape { spawn "ghostty" "-e" "sudo" "btop"; } + + // window management + Mod+Q { close-window; } + Mod+Alt+Space { toggle-window-floating; } + Mod+F { fullscreen-window; } + Mod+D { maximize-column; } + + // focus + Mod+Left { focus-column-left; } + Mod+Right { focus-column-right; } + Mod+Up { focus-window-up; } + Mod+Down { focus-window-down; } + + // move windows + Mod+Shift+Left { move-column-left; } + Mod+Shift+Right { move-column-right; } + Mod+Shift+Up { move-window-up; } + Mod+Shift+Down { move-window-down; } + + // workspaces by number + Mod+1 { focus-workspace 1; } + Mod+2 { focus-workspace 2; } + Mod+3 { focus-workspace 3; } + Mod+4 { focus-workspace 4; } + Mod+5 { focus-workspace 5; } + Mod+6 { focus-workspace 6; } + Mod+7 { focus-workspace 7; } + Mod+8 { focus-workspace 8; } + Mod+9 { focus-workspace 9; } + Mod+0 { focus-workspace 10; } + + Mod+Shift+1 { move-window-to-workspace 1; } + Mod+Shift+2 { move-window-to-workspace 2; } + Mod+Shift+3 { move-window-to-workspace 3; } + Mod+Shift+4 { move-window-to-workspace 4; } + Mod+Shift+5 { move-window-to-workspace 5; } + Mod+Shift+6 { move-window-to-workspace 6; } + Mod+Shift+7 { move-window-to-workspace 7; } + Mod+Shift+8 { move-window-to-workspace 8; } + Mod+Shift+9 { move-window-to-workspace 9; } + Mod+Shift+0 { move-window-to-workspace 10; } + + // mouse workspace scroll + Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } + Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } + + // media + Mod+Shift+N { spawn "playerctl" "next"; } + Mod+Shift+B { spawn "playerctl" "previous"; } + Mod+Shift+P { spawn "playerctl" "play-pause"; } + + XF86AudioRaiseVolume allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "volume" "increase"; } + XF86AudioLowerVolume allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "volume" "decrease"; } + XF86AudioMute allow-when-locked=true { spawn "noctalia-shell" "ipc" "call" "volume" "muteOutput"; } + XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_SOURCE@" "toggle"; } + XF86MonBrightnessUp { spawn "noctalia-shell" "ipc" "call" "brightness" "increase"; } + XF86MonBrightnessDown { spawn "noctalia-shell" "ipc" "call" "brightness" "decrease"; } + XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; } + XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; } + XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; } + XF86AudioPause allow-when-locked=true { spawn "playerctl" "play-pause"; } +} + +window-rule { + match title=r#"Open File.*"# + open-floating true +} + +window-rule { + match title=r#"Save As.*"# + open-floating true +} + +window-rule { + match title=r#"File Upload.*"# + open-floating true +} + +window-rule { + match app-id=r#"pavucontrol"# + open-floating true + default-column-width { fixed 800; } +} + +window-rule { + match title=r#"(?i)picture.in.picture"# + open-floating true +} + +window-rule { + match app-id=r#"steam"# + open-floating true +} + +window-rule { + match app-id=r#"steam"# title="Steam" + open-floating false +} diff --git a/modules/nixos/desktop/window-managers/default.nix b/modules/nixos/desktop/window-managers/default.nix index 7c7659f..18edd6b 100755 --- a/modules/nixos/desktop/window-managers/default.nix +++ b/modules/nixos/desktop/window-managers/default.nix @@ -2,6 +2,6 @@ { imports = [ - ./plasma.nix + ./niri.nix ]; } diff --git a/modules/nixos/desktop/window-managers/niri.nix b/modules/nixos/desktop/window-managers/niri.nix new file mode 100644 index 0000000..7c058ed --- /dev/null +++ b/modules/nixos/desktop/window-managers/niri.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +{ + programs.niri.enable = true; + + environment.systemPackages = with pkgs; [ + xwayland-satellite + ]; +}