292 lines
No EOL
12 KiB
Text
292 lines
No EOL
12 KiB
Text
// 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
|
||
}
|
||
numlock // Enable numlock on startup
|
||
}
|
||
|
||
touchpad {
|
||
tap // Enable tap-to-click
|
||
natural-scroll // Enable natural (macOS-style) scrolling
|
||
}
|
||
|
||
focus-follows-mouse // Automatically focus windows under the mouse pointer
|
||
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-1" {
|
||
mode "2560x1440@359.979" // Set resolution and refresh rate
|
||
scale 1 // No scaling (use 2 for HiDPI)
|
||
}
|
||
|
||
// ────────────── Keybindings ──────────────
|
||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Key-Bindings
|
||
|
||
binds {
|
||
MOD+SHIFT+ESCAPE { show-hotkey-overlay; }
|
||
|
||
// ─── Applications ───
|
||
MOD+RETURN hotkey-overlay-title="Open Terminal: Kitty" { spawn "kitty"; }
|
||
MOD+CTRL+RETURN hotkey-overlay-title="Open App Launcher: QS" { spawn "qs" "ipc" "call" "globalIPC" "toggleLauncher"; }
|
||
MOD+B hotkey-overlay-title="Open Browser: firefox" { spawn "firefox"; }
|
||
MOD+ALT+L hotkey-overlay-title="Lock Screen: swaylock" { spawn "swaylock"; }
|
||
|
||
// Please choose your own file manager
|
||
MOD+E hotkey-overlay-title="File Manager: Nautilus" { spawn "nautilus"; }
|
||
|
||
// ─── Audio Controls ───
|
||
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"; }
|
||
|
||
// ─── 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+T { toggle-window-floating; }
|
||
MOD+F { fullscreen-window; }
|
||
MOD+W { toggle-column-tabbed-display; }
|
||
|
||
// ─── Screenshots ───
|
||
CTRL+SHIFT+1 { screenshot; }
|
||
CTRL+SHIFT+2 { screenshot-screen; }
|
||
CTRL+SHIFT+3 { 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+O repeat=false { toggle-overview; }
|
||
}
|
||
|
||
// ────────────── Startup Applications ──────────────
|
||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#spawn-at-startup
|
||
|
||
spawn-at-startup "/usr/lib/polkit-kde-authentication-agent-1" "&" // Polkit
|
||
spawn-at-startup "xwayland-satellite" // XWayland support
|
||
spawn-at-startup "swww-daemon" // Wallpaper daemon
|
||
spawn-at-startup "swww img" "/usr/share/wallpapers/cachyos-wallpapers/Skyscraper.png" // Set wallpaper
|
||
spawn-at-startup "qs" // Launch Quickshell
|
||
spawn-at-startup "vesktop" // Launch Vesktop
|
||
|
||
prefer-no-csd // Disable program decorations
|
||
screenshot-path null // Disable screenshot saving
|
||
|
||
// ────────────── Layout Settings ──────────────
|
||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
|
||
|
||
layout {
|
||
gaps 16 // Gap between windows
|
||
center-focused-column "never" // Don’t auto-center focused column
|
||
|
||
preset-column-widths {
|
||
proportion 0.33333
|
||
proportion 0.5
|
||
proportion 0.66667
|
||
}
|
||
|
||
focus-ring {
|
||
width 3
|
||
active-color "{{ color4 }}"
|
||
inactive-color "{{ color0 }}"
|
||
}
|
||
|
||
shadow {
|
||
softness 30
|
||
spread 5
|
||
offset x=0 y=5
|
||
color "#0007"
|
||
}
|
||
|
||
background-color "transparent"
|
||
|
||
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
|
||
}
|
||
}
|
||
|
||
// ────────────── Named Workspaces ──────────────
|
||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
|
||
|
||
workspace "browser"
|
||
workspace "chat"
|
||
|
||
// ────────────── Window Rules ──────────────
|
||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
|
||
|
||
window-rule {
|
||
match at-startup=true app-id="vesktop"
|
||
open-on-workspace "chat"
|
||
open-maximized true
|
||
}
|
||
|
||
window-rule {
|
||
match app-id="firefox"
|
||
open-on-workspace "browser"
|
||
open-maximized true
|
||
}
|
||
|
||
window-rule {
|
||
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
|
||
open-floating true // Always float Firefox PiP windows
|
||
}
|
||
|
||
window-rule {
|
||
geometry-corner-radius 20 // Set every window radius to 20
|
||
clip-to-geometry true
|
||
}
|
||
|
||
// ────────────── Layer Rules ──────────────
|
||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layer-Rules
|
||
|
||
layer-rule {
|
||
match namespace="^swww-daemon$"
|
||
place-within-backdrop true
|
||
}
|
||
|
||
// ────────────── Environment Variables ──────────────
|
||
// https://github.com/YaLTeR/niri/wiki/Configuration:-Miscellaneous#environment
|
||
|
||
environment {
|
||
DISPLAY ":1"
|
||
ELECTRON_OZONE_PLATFORM_HINT "auto"
|
||
QT_QPA_PLATFORM "wayland"
|
||
QT_WAYLAND_DISABLE_WINDOWDECORATION "1"
|
||
XDG_SESSION_TYPE "wayland"
|
||
XDG_CURRENT_DESKTOP "niri"
|
||
}
|
||
|
||
// ────────────── Misc ──────────────
|
||
hotkey-overlay {
|
||
skip-at-startup
|
||
} |