Files
nix-config/modules/sessions/niri/config.kdl
T

427 lines
15 KiB
KDL
Raw Normal View History

2026-03-22 21:30:03 +05:00
// Find the full list of options on the wiki:
// https://yalter.github.io/niri/Configuration:-Input
2026-05-10 22:25:04 +07:00
//###########################
// настройки ввода
//###########################
2026-03-22 21:30:03 +05:00
input {
2026-05-10 22:25:04 +07:00
//###########################
// настройки клавиатуры
//###########################
2026-03-22 21:30:03 +05:00
keyboard {
xkb {
2026-05-10 22:25:04 +07:00
// Раскладка
2026-03-22 21:30:03 +05:00
layout "us,ru"
2026-05-10 22:25:04 +07:00
// переключение
options "grp:alt_shift_toggle"
2026-03-22 21:30:03 +05:00
}
2026-04-15 19:15:43 +05:00
repeat-delay 250
repeat-rate 25
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
// сразу включить NumLock
2026-05-07 19:42:20 +07:00
numlock
2026-03-22 21:30:03 +05:00
}
2026-05-10 22:25:04 +07:00
//###########################
// настройки мышки, тачпада
//###########################
2026-03-22 21:30:03 +05:00
touchpad {
2026-05-07 19:42:20 +07:00
off
// tap
2026-03-22 21:30:03 +05:00
// dwt
// dwtp
// drag false
// drag-lock
2026-05-07 19:42:20 +07:00
// natural-scroll
2026-03-22 21:30:03 +05:00
// accel-speed 0.2
// accel-profile "flat"
// scroll-method "two-finger"
// disabled-on-external-mouse
}
mouse {
// off
// natural-scroll
// accel-speed 0.2
accel-profile "flat"
// scroll-method "no-scroll"
}
2026-05-10 22:25:04 +07:00
// перенести мышку на новое окно
2026-05-11 12:59:24 +07:00
//warp-mouse-to-focus
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
// автофокус при наведении мышки
2026-03-22 21:30:03 +05:00
// Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
focus-follows-mouse max-scroll-amount="90%"
2026-03-22 21:30:03 +05:00
}
2026-05-10 22:25:04 +07:00
//###########################
// мониторы
//###########################
// You can configure outputs by their name, which you can find by running `niri msg outputs` while inside a niri instance.
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
output "eDP-1" {
2026-03-22 21:30:03 +05:00
// Resolution and, optionally, refresh rate of the output.
// The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
2026-05-10 22:25:04 +07:00
// If the refresh rate is omitted, niri will pick the highest refresh rate for the resolution.
2026-03-22 21:30:03 +05:00
// If the mode is omitted altogether or is invalid, niri will pick one automatically.
// Run `niri msg outputs` while inside a niri instance to list all outputs and their modes.
mode "1920x1080@60"
2026-05-10 22:25:04 +07:00
// увеличение, for example use 1.5 for 150% scale.
2026-03-22 21:30:03 +05:00
scale 1
2026-05-10 22:25:04 +07:00
// поворот, значения: normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
2026-03-22 21:30:03 +05:00
transform "normal"
2026-05-10 22:25:04 +07:00
// позиционирование нескольких мониторов
2026-03-22 21:30:03 +05:00
// Position of the output in the global coordinate space.
// This affects directional monitor actions like "focus-monitor-left", and cursor movement.
// The cursor can only move between directly adjacent outputs.
// Output scale and rotation has to be taken into account for positioning:
// outputs are sized in logical, or scaled, pixels.
// For example, a 3840×2160 output with scale 2.0 will have a logical size of 1920×1080,
// so to put another output directly adjacent to it on the right, set its x to 1920.
// If the position is unset or results in an overlap, the output is instead placed
// automatically.
// position x=1280 y=0
}
2026-05-10 22:25:04 +07:00
// выключить тени при обзоре всех окон
overview {
workspace-shadow {
off
}
}
2026-04-30 12:59:31 +05:00
2026-05-10 22:25:04 +07:00
//###########################
// поведение окон
//###########################
2026-03-22 21:30:03 +05:00
layout {
2026-05-10 22:25:04 +07:00
// отступ между окон
2026-04-30 12:59:31 +05:00
gaps 8
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
// одно окно по центру
2026-03-22 21:30:03 +05:00
always-center-single-column
2026-05-10 22:25:04 +07:00
// прозрачные рабочие столы чтобы видеть обои круто
2026-04-27 11:04:25 +05:00
background-color "transparent"
2026-05-10 22:25:04 +07:00
// центрировать окно в фокусе
2026-03-22 21:30:03 +05:00
// - "never", default behavior, focusing an off-screen column will keep at the left
// - "on-overflow", focusing a column will center it if it doesn't fit
center-focused-column "never"
2026-05-10 22:25:04 +07:00
// ширина окна
2026-03-22 21:30:03 +05:00
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
}
2026-05-10 22:25:04 +07:00
// ширина окна на старте
2026-03-22 21:30:03 +05:00
default-column-width { proportion 0.5; }
2026-05-10 22:25:04 +07:00
// подсветка активного окна
2026-03-22 21:30:03 +05:00
focus-ring {
2026-05-10 22:25:04 +07:00
// ширина обводки
2026-04-30 12:59:31 +05:00
width 2
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
// Cцвет обводки
active-color "#FFFF"
2026-03-22 21:30:03 +05:00
}
2026-05-10 22:25:04 +07:00
// обводка всегда видна
2026-03-22 21:30:03 +05:00
border {
// The settings are the same as for the focus ring.
// If you enable the border, you probably want to disable the focus ring.
2026-04-30 22:12:40 +05:00
off
2026-04-30 12:59:31 +05:00
width 2
2026-03-22 21:30:03 +05:00
}
2026-05-10 22:25:04 +07:00
// тени
2026-03-22 21:30:03 +05:00
shadow {
// Uncomment the next line to enable shadows.
// on
}
2026-05-10 22:25:04 +07:00
// постоянные отступы на экране
2026-03-22 21:30:03 +05:00
struts {
2026-05-10 22:25:04 +07:00
left 64
right 64
2026-03-22 21:30:03 +05:00
// top 64
// bottom 64
}
}
2026-05-10 22:25:04 +07:00
//###########################
// автозапуск
//###########################
2026-04-30 13:40:52 +05:00
spawn-at-startup "noctalia-shell" // Shell.
2026-05-10 22:25:04 +07:00
spawn-at-startup "kitty" // terminal
2026-03-22 21:30:03 +05:00
// To run a shell command (with variables, pipes, etc.), use spawn-sh-at-startup:
// spawn-sh-at-startup "qs -c ~/source/qs/MyAwesomeShell"
hotkey-overlay {
2026-05-10 22:25:04 +07:00
// выключить подсказку на старте
2026-03-22 21:30:03 +05:00
skip-at-startup
}
// Uncomment this line to ask the clients to omit their client-side decorations if possible.
// If the client will specifically ask for CSD, the request will be honored.
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
// This option will also fix border/focus ring drawing behind some semitransparent windows.
// After enabling or disabling this, you need to restart the apps for this to take effect.
prefer-no-csd
2026-05-10 22:25:04 +07:00
//###########################
// место для скриншотов
//###########################
2026-03-22 21:30:03 +05:00
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
2026-05-10 22:25:04 +07:00
//###########################
// анимации
//###########################
2026-03-22 21:30:03 +05:00
animations {
// Uncomment to turn off all animations.
// off
// Slow down all animations by this factor. Values below 1 speed them up instead.
2026-05-10 22:25:04 +07:00
slowdown 2.0
2026-03-22 21:30:03 +05:00
}
2026-05-10 22:25:04 +07:00
//###########################
// чето понты какие-то
//###########################
2026-04-27 11:04:25 +05:00
layer-rule {
match namespace="^noctalia-overview*"
place-within-backdrop true
2026-04-27 11:04:25 +05:00
}
// Example: enable rounded corners for all windows.
window-rule {
clip-to-geometry true
/* Apps: blur them all without xray for a better look */
background-effect {
blur true
}
}
/* Noctalia: blur everywhere without xray for a better look */
layer-rule {
match namespace="^noctalia-(background|launcher-overlay|dock)-.*$"
background-effect {
xray false
}
}
2026-03-22 21:30:03 +05:00
window-rule {
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
}
2026-05-10 22:25:04 +07:00
// firefox PiP в плавающем окне
2026-03-22 21:30:03 +05:00
window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
open-floating true
}
2026-05-10 22:25:04 +07:00
//###########################
// спрятать окна от скриншотов
//###########################
window-rule {
2026-03-22 21:30:03 +05:00
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
block-out-from "screen-capture"
// Use this instead if you want them visible on third-party screenshot tools.
// block-out-from "screencast"
}
2026-05-10 22:25:04 +07:00
//###########################
// бинды клавиш
//###########################
2026-03-22 21:30:03 +05:00
binds {
2026-05-10 22:25:04 +07:00
// показать подсказку
2026-03-22 21:30:03 +05:00
Mod+Shift+Slash { show-hotkey-overlay; }
2026-05-10 22:25:04 +07:00
// запуск программ
Mod+Ctrl+T hotkey-overlay-title=null { spawn-sh "Telegram"; }
Mod+Ctrl+B hotkey-overlay-title=null { spawn-sh "firefox"; }
Mod+Ctrl+C hotkey-overlay-title=null { spawn-sh "code"; }
Mod+T hotkey-overlay-title=null { spawn "kitty"; }
2026-03-22 21:30:03 +05:00
Mod+E hotkey-overlay-title=null { spawn "nautilus"; }
Mod+P { spawn-sh "noctalia-shell ipc call launcher toggle"; }
Mod+S { spawn-sh "noctalia-shell ipc call settings toggle"; }
2026-05-10 22:25:04 +07:00
//
// надо посмотреть
//
//
2026-03-22 21:30:03 +05:00
// 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.
// "-l 1.0" limits the volume to 100%.
XF86AudioRaiseVolume allow-when-locked=true { spawn-sh "wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.05+ -l 1.0"; }
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"; }
// Example media keys mapping using playerctl.
// This will work with any MPRIS-enabled media player.
XF86AudioPlay allow-when-locked=true { spawn-sh "playerctl play-pause"; }
XF86AudioStop allow-when-locked=true { spawn-sh "playerctl stop"; }
XF86AudioPrev allow-when-locked=true { spawn-sh "playerctl previous"; }
XF86AudioNext allow-when-locked=true { spawn-sh "playerctl next"; }
// Example brightness key mappings for brightnessctl.
// You can use regular spawn with multiple arguments too (to avoid going through "sh"),
// but you need to manually put each argument in separate "" quotes.
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "+5%"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "--class=backlight" "set" "5%-"; }
2026-05-10 22:25:04 +07:00
// обзор
2026-03-22 21:30:03 +05:00
Mod+O repeat=false { toggle-overview; }
2026-05-10 22:25:04 +07:00
// закрыть окно
2026-03-22 21:30:03 +05:00
Mod+C repeat=false { close-window; }
2026-05-10 22:25:04 +07:00
// управление фокусом ----------------------------------------------------
// перемещение фокуса
2026-03-22 21:30:03 +05:00
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
2026-05-10 22:25:04 +07:00
// фокус на мониторах
Mod+Shift+Left { focus-monitor-left; }
Mod+Shift+Down { focus-monitor-down; }
Mod+Shift+Up { focus-monitor-up; }
Mod+Shift+Right { focus-monitor-right; }
// управление окнами ----------------------------------------------------
// перемещение окон
Mod+Ctrl+Left { move-column-left; }
Mod+Ctrl+Down { move-window-down; }
Mod+Ctrl+Up { move-window-up; }
Mod+Ctrl+Right { move-column-right; }
2026-03-22 21:30:03 +05:00
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
2026-05-10 22:25:04 +07:00
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Comma { consume-or-expel-window-left; }
Mod+Period { consume-or-expel-window-right; }
// управление размером окон
Mod+R { switch-preset-column-width; } // ширина
Mod+Shift+R { switch-preset-window-height; } // высота
Mod+Ctrl+R { reset-window-height; }
Mod+M { maximize-column; }
Mod+F { fullscreen-window; }
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+Shift+V { switch-focus-between-floating-and-tiling; }
//застакать окна
Mod+W { toggle-column-tabbed-display; }
//растянуть окно насколько возможно
Mod+Ctrl+F { expand-column-to-available-width; }
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
//Mod+Ctrl+C { center-column; }
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
// Center all fully visible columns on screen.
//Mod+Alt+C { center-visible-columns; }
// перемещение окон по областям
Mod+Alt+1 { move-column-to-workspace 1; }
Mod+Alt+2 { move-column-to-workspace 2; }
Mod+Alt+3 { move-column-to-workspace 3; }
Mod+Alt+4 { move-column-to-workspace 4; }
Mod+Alt+5 { move-column-to-workspace 5; }
Mod+Alt+6 { move-column-to-workspace 6; }
Mod+Alt+7 { move-column-to-workspace 7; }
Mod+Alt+8 { move-column-to-workspace 8; }
Mod+Alt+9 { move-column-to-workspace 9; }
// перемещение окон по мониторам
2026-03-22 21:30:03 +05:00
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; }
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; }
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; }
2026-05-10 22:25:04 +07:00
// управление рабочими областями ----------------------------------------------------
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
// переместить область
Mod+Alt+Ctrl+Left { move-workspace-to-monitor-left; }
Mod+Alt+Ctrl+Right { move-workspace-to-monitor-right; }
Mod+Alt+Ctrl+Up { move-workspace-to-monitor-up; }
Mod+Alt+Ctrl+Down { move-workspace-to-monitor-down; }
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
// фокус на области
2026-03-22 21:30:03 +05:00
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
2026-05-10 22:25:04 +07:00
2026-03-22 21:30:03 +05:00
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; }
2026-05-10 22:25:04 +07:00
// ####################
// нахуй мышку
// ####################
//Mod+WheelScrollDown cooldown-ms=50 { focus-workspace-down; }
//Mod+WheelScrollUp cooldown-ms=50 { focus-workspace-up; }
//Mod+Ctrl+WheelScrollDown cooldown-ms=50 { move-column-to-workspace-down; }
//Mod+Ctrl+WheelScrollUp cooldown-ms=50 { move-column-to-workspace-up; }
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
//Mod+WheelScrollRight { focus-column-right; }
//Mod+WheelScrollLeft { focus-column-left; }
//Mod+Ctrl+WheelScrollRight { move-column-right; }
//Mod+Ctrl+WheelScrollLeft { move-column-left; }
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
// Usually scrolling up and down with Shift in applications results in
// horizontal scrolling; these binds replicate that.
//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; }
2026-03-22 21:30:03 +05:00
2026-05-10 22:25:04 +07:00
//###################################
//скриншоты
//###################################
2026-03-22 21:30:03 +05:00
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
2026-05-10 22:25:04 +07:00
// выход
2026-03-22 21:30:03 +05:00
Ctrl+Alt+Delete { quit; }
2026-04-30 13:40:52 +05:00
Mod+Shift+E { spawn-sh "noctalia-shell ipc call sessionMenu toggle"; }
2026-03-22 21:30:03 +05:00
// Powers off the monitors. To turn them back on, do any input like
// moving the mouse or pressing any other key.
Mod+Shift+P { power-off-monitors; }
}