From fcb144021bfe4a3860a1f6b563195e0611cf9905 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Wed, 25 Jun 2025 17:48:23 -0400 Subject: [PATCH] niri --- configs/niri-config.kdl | 149 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 configs/niri-config.kdl diff --git a/configs/niri-config.kdl b/configs/niri-config.kdl new file mode 100644 index 0000000..756a6f4 --- /dev/null +++ b/configs/niri-config.kdl @@ -0,0 +1,149 @@ +// https://github.com/YaLTeR/niri/wiki/Configuration:-Input +input { + touchpad { + tap + natural-scroll + } +} +spawn-at-startup "xwayland-satellite" +spawn-at-startup "ghostty" +spawn-at-startup "mako" +spawn-at-startup "sfwbar" + +environment { + DISPLAY ":0" +} + + +// ========================= +// Outputs +// ========================= +output "eDP-1" { + mode "1920x1080@120.030" + scale 1 + transform "normal" + position x=0 y=0 +} + +// Two Screens in Office +output "Samsung Electric Company S22R35x H4TR604392" { + mode "1920x1080@60.000" + scale 1 + transform "normal" + position x=-960 y=-1080 +} + +output "Samsung Electric Company S22R35x H4TR503886" { + mode "1920x1080@60.000" + scale 1 + transform "normal" + position x=980 y=-1080 +} + +// ========================= +// General layout +// ========================= +layout { + gaps 8 + 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 4 + active-color "#7fc8ff" + inactive-color "#505050" + } +} + +// ========================= +// Screen Shots +// ========================= +screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" + +// ========================= +// Window Rules +// ========================= +// Open the Firefox picture-in-picture player as floating by default. +window-rule { + match app-id=r#"firefox$"# title="^Picture-in-Picture$" + open-floating true +} +window-rule { + match is-active=false + opacity 0.85 +} +window-rule { + match app-id=r#"^Slack$"# + match app-id=r#"^code$"# + exclude app-id=r#"^code$"# title=r#"^Visual Studio Code$"# + open-maximized true + open-fullscreen true + open-floating false +} +//window-rule { +// match app-id=r#"^code$"# title=r#"^Visual Studio Code$"# +// open-floating true +//} +// ========================= +// General Stuff +// ========================= +switch-events { + lid-close { spawn "notify-send" "The laptop lid is closed!"; } + lid-open { spawn "notify-send" "The laptop lid is open!"; } +} +hotkey-overlay { + skip-at-startup +} + +// ========================= +// General binds +// ========================= +binds { + Mod+Shift+H { show-hotkey-overlay; } + Mod+T { spawn "ghostty"; } + Mod+Space { spawn "fuzzel"; } + Mod+B { spawn "chromium"; } + Mod+E { spawn "wofi-emoji"; } + XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } + XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } + XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } + XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } + + + Mod+Left { focus-column-left; } + Mod+Down { focus-workspace-down; } + Mod+Up { focus-workspace-up; } + Mod+Right { focus-column-right; } + + Mod+Shift+Tab { focus-monitor-next; } + + Mod+Ctrl+Right { swap-window-right; } + Mod+Ctrl+Left { swap-window-left; } + Mod+Ctrl+Up { move-window-to-workspace-up; } + Mod+Ctrl+Down { move-window-to-workspace-down; } + + Mod+F { maximize-column; } + Mod+Shift+F { fullscreen-window; } + Mod+Ctrl+F { reset-window-height; } + + Mod+C { center-column; } + + Mod+Minus { set-column-width "-10%"; } + Mod+Equal { set-column-width "+10%"; } + + Mod+Shift+Minus { set-window-height "-10%"; } + Mod+Shift+Equal { set-window-height "+10%"; } + + Mod+V { toggle-window-floating; } + Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } + + Print { screenshot; } + Mod+P { screenshot; } + + Ctrl+Alt+Delete { quit; } + Mod+Q { close-window; } +}