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

427 lines
15 KiB
KDL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Find the full list of options on the wiki:
// https://yalter.github.io/niri/Configuration:-Input
//###########################
// настройки ввода
//###########################
input {
//###########################
// настройки клавиатуры
//###########################
keyboard {
xkb {
// Раскладка
layout "us,ru"
// переключение
options "grp:alt_shift_toggle"
}
repeat-delay 250
repeat-rate 25
// сразу включить NumLock
numlock
}
//###########################
// настройки мышки, тачпада
//###########################
touchpad {
off
// tap
// dwt
// dwtp
// drag false
// drag-lock
// natural-scroll
// 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"
}
// перенести мышку на новое окно
//warp-mouse-to-focus
// автофокус при наведении мышки
// Setting max-scroll-amount="0%" makes it work only on windows already fully on screen.
focus-follows-mouse max-scroll-amount="90%"
}
//###########################
// мониторы
//###########################
// You can configure outputs by their name, which you can find by running `niri msg outputs` while inside a niri instance.
output "eDP-1" {
// Resolution and, optionally, refresh rate of the output.
// The format is "<width>x<height>" or "<width>x<height>@<refresh rate>".
// If the refresh rate is omitted, niri will pick the highest refresh rate for the resolution.
// 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"
// увеличение, for example use 1.5 for 150% scale.
scale 1
// поворот, значения: normal, 90, 180, 270, flipped, flipped-90, flipped-180 and flipped-270.
transform "normal"
// позиционирование нескольких мониторов
// 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
}
// выключить тени при обзоре всех окон
overview {
workspace-shadow {
off
}
}
//###########################
// поведение окон
//###########################
layout {
// отступ между окон
gaps 8
// одно окно по центру
always-center-single-column
// прозрачные рабочие столы чтобы видеть обои круто
background-color "transparent"
// центрировать окно в фокусе
// - "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"
// ширина окна
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
}
// ширина окна на старте
default-column-width { proportion 0.5; }
// подсветка активного окна
focus-ring {
// ширина обводки
width 2
// Cцвет обводки
active-color "#FFFF"
}
// обводка всегда видна
border {
// The settings are the same as for the focus ring.
// If you enable the border, you probably want to disable the focus ring.
off
width 2
}
// тени
shadow {
// Uncomment the next line to enable shadows.
// on
}
// постоянные отступы на экране
struts {
left 64
right 64
// top 64
// bottom 64
}
}
//###########################
// автозапуск
//###########################
spawn-at-startup "noctalia-shell" // Shell.
spawn-at-startup "kitty" // terminal
// 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 {
// выключить подсказку на старте
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
//###########################
// место для скриншотов
//###########################
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
//###########################
// анимации
//###########################
animations {
// Uncomment to turn off all animations.
// off
// Slow down all animations by this factor. Values below 1 speed them up instead.
slowdown 2.0
}
//###########################
// чето понты какие-то
//###########################
layer-rule {
match namespace="^noctalia-overview*"
place-within-backdrop true
}
// 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
}
}
window-rule {
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
}
// firefox PiP в плавающем окне
window-rule {
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
open-floating true
}
//###########################
// спрятать окна от скриншотов
//###########################
window-rule {
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"
}
//###########################
// бинды клавиш
//###########################
binds {
// показать подсказку
Mod+Shift+Slash { show-hotkey-overlay; }
// запуск программ
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"; }
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"; }
//
// надо посмотреть
//
//
// 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%-"; }
// обзор
Mod+O repeat=false { toggle-overview; }
// закрыть окно
Mod+C repeat=false { close-window; }
// управление фокусом ----------------------------------------------------
// перемещение фокуса
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; }
// фокус на мониторах
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; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
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; }
//Mod+Ctrl+C { center-column; }
// 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; }
// перемещение окон по мониторам
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; }
// управление рабочими областями ----------------------------------------------------
// переместить область
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; }
// фокус на области
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; }
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+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; }
//Mod+WheelScrollRight { focus-column-right; }
//Mod+WheelScrollLeft { focus-column-left; }
//Mod+Ctrl+WheelScrollRight { move-column-right; }
//Mod+Ctrl+WheelScrollLeft { move-column-left; }
// 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; }
//###################################
//скриншоты
//###################################
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
// выход
Ctrl+Alt+Delete { quit; }
Mod+Shift+E { spawn-sh "noctalia-shell ipc call sessionMenu toggle"; }
// 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; }
}