add: niri dotfile

This commit is contained in:
Melvin Ragusa
2026-02-02 11:07:57 +01:00
parent 281c4c6e73
commit 139c28ec9c

338
.config/niri/config.kdl Normal file
View File

@@ -0,0 +1,338 @@
// Niri configuration for CachyOS
// For documentation and full reference, see: https://github.com/YaLTeR/niri/wiki
// ────────────── Input Configuration ──────────────
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
input {
keyboard {
xkb {
layout "de" // Use the German keyboard layout
variant "nodeadkeys"
}
numlock // Enable numlock on startup
}
touchpad {
tap // Enable tap-to-click
natural-scroll // Enable natural (macOS-style) scrolling
}
workspace-auto-back-and-forth // Enable workspace back & forth switching
}
// ────────────── Output Configuration ──────────────
// You can run `niri msg outputs` to get the correct name for your displays.
// You will have to remove "/-" and edit it before it takes effect.
// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
output "DP-2" {
mode "1920x1080@144.001" // Set resolution and refresh rate
scale 1 // No scaling (use 2 for HiDPI)
focus-at-startup // Main Display
}
output "HDMI-A-1" {
mode "1920x1080@60.000" // Set resolution and refresh rate
scale 1 // No scaling (use 2 for HiDPI)
//off
}
// ────────────── Keybindings ──────────────
// https://github.com/YaLTeR/niri/wiki/Configuration:-Key-Bindings
binds {
// ---- Hotkey Overlay
MOD+SHIFT+BACKSPACE { show-hotkey-overlay; }
// ─── Noctalia ───
// MOD+SPACE hotkey-overlay-title="Open App Launcher" { spawn-sh "qs -c noctalia-shell ipc call launcher toggle"; }
MOD+SHIFT+L hotkey-overlay-title="Lock Screen" { spawn-sh "qs -c noctalia-shell ipc call lockScreen lock"; }
MOD+S hotkey-overlay-title="Open Control Center" { spawn-sh "qs -c noctalia-shell ipc call controlCenter toggle";}
MOD+COMMA hotkey-overlay-title="Open Settings" { spawn-sh "qs -c noctalia-shell ipc call settings toggle"; }
MOD+SHIFT+DELETE hotkey-overlay-title="Session Menu" { spawn-sh "qs -c noctalia-shell ipc call sessionMenu toggle"; }
MOD+N hotkey-overlay-title="Notification History" { spawn-sh "qs -c noctalia-shell ipc call notifications toggleHistory"; }
MOD+M hotkey-overlay-title="Wallpaper Selector" { spawn-sh "qs -c noctalia-shell ipc call wallpaper toggle"; }
// ─── Applications ───
MOD+T hotkey-overlay-title="Open Terminal: ghostty" { spawn-sh "ghostty"; }
MOD+B hotkey-overlay-title="Open Browser: Zen" { spawn-sh "zen-browser"; }
MOD+E hotkey-overlay-title="File Manager: Thunar" { spawn-sh "thunar"; }
MOD+SPACE repeat=false hotkey-overlay-title="Open App Launcher" { spawn "vicinae" "toggle"; }
MOD+G hotkey-overlay-title="Open Google Gemini" { spawn-sh "/usr/bin/chromium --profile-directory=Default --app-id=gdfaincndogidkdcdkhapmbffkckdkhn
"; }
// ─── Audio Controls ───
// Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked.
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.1-"; }
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"; }
XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; }
XF86AudioPause allow-when-locked=true { spawn-sh "playerctl play-pause"; }
XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; }
XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; }
// ─── Window Movement and Focus ───
MOD+Q { close-window; }
MOD+LEFT { focus-column-left; }
MOD+H { focus-column-left; }
MOD+RIGHT { focus-column-right; }
MOD+L { focus-column-right; }
MOD+UP { focus-window-up; }
MOD+K { focus-window-up; }
MOD+DOWN { focus-window-down; }
MOD+J { focus-window-down; }
MOD+CTRL+LEFT { move-column-left; }
MOD+CTRL+H { move-column-left; }
MOD+CTRL+RIGHT { move-column-right; }
MOD+CTRL+L { move-column-right; }
MOD+CTRL+UP { move-window-up; }
MOD+CTRL+K { move-window-up; }
MOD+CTRL+DOWN { move-window-down; }
MOD+CTRL+J { move-window-down; }
MOD+HOME { focus-column-first; }
MOD+END { focus-column-last; }
MOD+CTRL+HOME { move-column-to-first; }
MOD+CTRL+END { move-column-to-last; }
MOD+SHIFT+LEFT { focus-monitor-left; }
MOD+SHIFT+RIGHT { focus-monitor-right; }
MOD+SHIFT+UP { focus-monitor-up; }
MOD+SHIFT+DOWN { focus-monitor-down; }
MOD+SHIFT+CTRL+LEFT { move-column-to-monitor-left; }
MOD+SHIFT+CTRL+RIGHT { move-column-to-monitor-right; }
MOD+SHIFT+CTRL+UP { move-column-to-monitor-up; }
MOD+SHIFT+CTRL+DOWN { move-column-to-monitor-down; }
// ─── Workspace Switching ───
MOD+WHEELSCROLLDOWN cooldown-ms=150 { focus-workspace-down; }
MOD+WHEELSCROLLUP cooldown-ms=150 { focus-workspace-up; }
MOD+CTRL+WHEELSCROLLDOWN cooldown-ms=150 { move-column-to-workspace-down; }
MOD+CTRL+WHEELSCROLLUP cooldown-ms=150 { move-column-to-workspace-up; }
MOD+WHEELSCROLLRIGHT { focus-column-right; }
MOD+WHEELSCROLLLEFT { focus-column-left; }
MOD+CTRL+WHEELSCROLLRIGHT { move-column-right; }
MOD+CTRL+WHEELSCROLLLEFT { move-column-left; }
MOD+SHIFT+WHEELSCROLLDOWN { focus-column-right; }
MOD+SHIFT+WHEELSCROLLUP { focus-column-left; }
MOD+CTRL+SHIFT+WHEELSCROLLDOWN { move-column-right; }
MOD+CTRL+SHIFT+WHEELSCROLLUP { move-column-left; }
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+CTRL+1 { move-column-to-workspace 1; }
MOD+CTRL+2 { move-column-to-workspace 2; }
MOD+CTRL+3 { move-column-to-workspace 3; }
MOD+CTRL+4 { move-column-to-workspace 4; }
MOD+CTRL+5 { move-column-to-workspace 5; }
MOD+CTRL+6 { move-column-to-workspace 6; }
MOD+CTRL+7 { move-column-to-workspace 7; }
MOD+CTRL+8 { move-column-to-workspace 8; }
MOD+CTRL+9 { move-column-to-workspace 9; }
MOD+TAB { focus-workspace-previous; }
// ─── Layout Controls ───
MOD+CTRL+F { expand-column-to-available-width; }
MOD+C { center-column; }
MOD+CTRL+C { center-visible-columns; }
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%"; }
// ─── Modes ───
MOD+Shift+T { toggle-window-floating; }
MOD+Shift+F { fullscreen-window; }
MOD+F { maximize-column; }
MOD+R { switch-preset-column-width; }
MOD+W { toggle-column-tabbed-display; }
// ─── Screenshots ───
Print { screenshot; }
Shift+Print { screenshot-screen; }
CTRL+Print { screenshot-window; }
// ─── Emergency Escape Key ───
// Use this when a fullscreen app blocks your keybinds.
// It disables any active keyboard shortcut inhibitor, restoring control.
MOD+ESCAPE allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; }
// ─── Exit / Power ───
CTRL+ALT+DELETE { quit; } // Also quits Niri
MOD+SHIFT+P { power-off-monitors; } // Turn off screens (useful for OLED or privacy)
MOD+D repeat=false { toggle-overview; }
}
// ────────────── Startup Applications ──────────────
// https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#spawn-sh-at-startup
spawn-sh-at-startup "/usr/lib/polkit-kde-authentication-agent-1 &" // Polkit
spawn-sh-at-startup "sleep 2 && vicinae server"
spawn-at-startup "xwayland-satellite"
// spawn-at-startup "wl-paste" "--type text" "--watch" "cliphist" "store"
// spawn-at-startup "wl-paste" "--type image" "--watch" "cliphist" "store"
spawn-sh-at-startup "steam -nochatui -nofriendsui -silent"
spawn-sh-at-startup "rclone mount google-drive: /home/pinj/google-drive/"
prefer-no-csd // Disable program decorations
screenshot-path null // Disable screenshot saving
// ────────────── Layout Settings ──────────────
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
layout {
gaps 5 // Gap between windows
center-focused-column "never" // Dont auto-center focused column
background-color "transparent"
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
}
focus-ring {
width 2
active-color "#6f6f6f"
inactive-color "#6f6f6f"
}
shadow {
softness 30
spread 5
offset x=0 y=5
color "#0007"
}
struts {}
}
// ────────────── Animation Settings ──────────────
// https://github.com/YaLTeR/niri/wiki/Configuration:-Animations
animations {
workspace-switch {
spring damping-ratio=1.0 stiffness=1000 epsilon=0.0001
}
window-open {
duration-ms 200
curve "ease-out-quad"
}
window-close {
duration-ms 200
curve "ease-out-cubic"
}
horizontal-view-movement {
spring damping-ratio=1.0 stiffness=900 epsilon=0.0001
}
window-movement {
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
}
window-resize {
spring damping-ratio=1.0 stiffness=1000 epsilon=0.0001
}
config-notification-open-close {
spring damping-ratio=0.6 stiffness=1200 epsilon=0.001
}
screenshot-ui-open {
duration-ms 300
curve "ease-out-quad"
}
overview-open-close {
spring damping-ratio=1.0 stiffness=900 epsilon=0.0001
}
}
// ────────────── Window Rules ──────────────
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
window-rule {
// Rounded corners for a modern look.
geometry-corner-radius 20
// Clips window contents to the rounded corner boundaries.
clip-to-geometry true
}
window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
// Always float Firefox PiP windows
open-floating true
}
window-rule {
match app-id=r#"thunar$"#
// Always float Thunar windows
open-floating true
// Set Window Proportions
max-height 1500
max-width 1500
}
window-rule {
match app-id=r#"ghostty$"#
draw-border-with-background false
}
// ────────────── Layer Rules ──────────────
// Set the regular wallpaper on the backdrop.
layer-rule {
match namespace="^noctalia-wallpaper*"
place-within-backdrop true
}
// Optionally, disable the workspace shadows in the overview.
overview {
workspace-shadow {
off
}
zoom 0.25
}
// Disable the hot corners.
gestures {
hot-corners {
off
}
}
// ────────────── Environment Variables ──────────────
// https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#environment
environment {
DISPLAY ":1"
ELECTRON_OZONE_PLATFORM_HINT "auto"
QT_QPA_PLATFORM "wayland"
QT_QPA_PLATFORMTHEME "qt6ct"
QT_WAYLAND_DISABLE_WINDOWDECORATION "1"
XDG_SESSION_TYPE "wayland"
XDG_CURRENT_DESKTOP "niri"
QS_ICON_THEME "Papirus-Dark"
}
hotkey-overlay {
skip-at-startup
}
debug {
// Allows notification actions and window activation from Noctalia.
honor-xdg-activation-with-invalid-serial
}
// ────────────── Noctalia Matugen Colorconfig ──────────────
include "./noctalia.kdl"