dotfiles/config/niri/config.kdl

240 lines
6.4 KiB
Text

// vim: foldenable foldmethod=marker ts=2 sw=2
// auto start {{{
spawn-at-startup "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
spawn-at-startup "~/.config/niri/waybar"
spawn-at-startup "dunst"
spawn-at-startup "hypridle" "-c" "/home/olex/.config/niri/hypridle.conf"
// }}}
// env {{{
environment {
QT_QPA_PLATFORM "wayland;xcb"
QT_WAYLAND_DISABLE_WINDOWDECORATION "1"
MOZ_ENABLE_WAYLAND "1"
}
// }}}
// inputs {{{
// https://github.com/YaLTeR/niri/wiki/Configuration:-Input
input {
keyboard {
xkb {
layout "us,ua"
options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
}
}
touchpad {
tap
dwt
// dwtp
// drag-lock
accel-speed 0.2
scroll-factor 1.5
accel-profile "adaptive"
click-method "clickfinger"
scroll-method "two-finger"
}
focus-follows-mouse max-scroll-amount="25%"
mouse {
accel-speed 0.0
accel-profile "flat"
}
}
/// }}}
// Monitors {{{
// https://github.com/YaLTeR/niri/wiki/Configuration:-Outputs
output "HDMI-A-1" {
focus-at-startup
mode "1920x1080@100.00"
scale 1
transform "normal"
position x=0 y=0
background-color "#000000"
}
output "eDP-1" {
focus-at-startup
mode "1920x1080@60.001"
scale 1
transform "normal"
position x=1920 y=144
background-color "#000010"
}
/// }}}
// Layout {{{
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
layout {
gaps 0
center-focused-column "never"
default-column-width { proportion 0.7; }
border { off; }
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
}
focus-ring {
width 2
active-color "#7aa2f7"
inactive-color "#292e42"
}
}
// }}}
// general {{{
// disables client-side decorrations if possible
prefer-no-csd
hotkey-overlay { skip-at-startup; }
animations { off; }
// set to null if u want disable saving to disk behavior
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
// }}}
// window/workspace rules {{{
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
// https://github.com/YaLTeR/niri/wiki/Configuration:-move-column-to-workspace
workspace "tools" { open-on-output "HDMI-A-1"; }
workspace "web" { open-on-output "HDMI-A-1"; }
workspace "dev" { open-on-output "HDMI-A-1"; }
workspace "laptop" { open-on-output "eDP-1"; }
window-rule {
match app-id="obsidian"
match app-id="thunderbird"
match app-id="org.telegram.desktop"
match app-id="io.gitlab.news_flash.NewsFlash"
open-on-workspace "tools"
}
window-rule {
match app-id="zen"
match app-id="firefox"
match app-id="Brave-browser"
match app-id="brave-browser"
open-on-workspace "web"
open-focused true
}
window-rule {
match app-id="Spotify"
match app-id="org.gnome.Snapshot"
match app-id="org.gnome.Calendar"
match app-id="sleek"
match app-id="org.keepassxc.KeePassXC"
open-on-workspace "laptop"
}
window-rule {
match app-id="org.gnome.Solanum"
default-floating-position relative-to="top-left" x=10 y=10
open-focused true
open-floating true
open-on-workspace "laptop"
}
window-rule {
match app-id="Spotify"
match app-id="zen"
match app-id="firefox"
match app-id="Brave-browser"
match app-id="kitty"
match app-id="ghostty"
match app-id="obsidian"
match app-id="Code"
match app-id="Zed"
open-maximized true
}
window-rule {
match app-id="pavucontrol"
match app-id="blueman-manager"
match app-id="xdg-desktop-portal-gtk"
open-floating true
}
window-rule {
match app-id="KeePassXC"
match app-id="obsidian"
match app-id="org.telegram.desktop"
block-out-from "screen-capture"
}
// }}}
// keybinds {{{
binds {
Mod+d { spawn "dunstctl" "close"; }
Mod+q { close-window; }
Mod+Alt+l { spawn "hyprlock"; }
Mod+Return { spawn "ghostty"; }
Mod+Shift+Escape { spawn "~/bin/wofi-power-menu" "niri";}
Mod+Shift+Return { spawn "wofi" "--show" "drun"; }
// programs {{{
Mod+Shift+a { spawn "anki"; }
Mod+Shift+d { spawn "obsidian"; }
Mod+Shift+f { spawn "newsflash"; }
Mod+Shift+r { spawn "solanum"; }
Mod+Shift+s { spawn "spotify"; }
Mod+Shift+t { spawn "Telegram"; }
Mod+Shift+w { spawn "brave"; }
// }}}
// func keys {{{
// audio
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"; }
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"; }
// brighthness
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "5%-"; }
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "+5%"; }
// screen shots
Print { screenshot; }
Alt+Print { screenshot-window; }
Ctrl+Print { screenshot-screen; }
// }}}
// wm {{{
Mod+O repeat=false { toggle-overview; }
Alt+Tab { focus-window-previous; }
// window management {{{
Mod+Ctrl+f { toggle-window-floating; }
Mod+r { switch-preset-column-width; }
Mod+t { maximize-column; }
Mod+f { fullscreen-window; }
Mod+Minus { set-column-width "-10%"; }
Mod+Equal { set-column-width "+10%"; }
Mod+h { focus-column-left; }
Mod+j { focus-window-down; }
Mod+k { focus-window-up; }
Mod+l { focus-column-right; }
Mod+Shift+h { move-column-left; }
Mod+Shift+j { move-window-down; }
Mod+Shift+k { move-window-up; }
Mod+Shift+l { move-column-right; }
// monitor navigation
Mod+Comma { focus-monitor-left; }
Mod+Period { focus-monitor-right; }
Mod+Shift+Comma { move-column-to-monitor-left; }
Mod+Shift+Period { move-column-to-monitor-right; }
// workspaces
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+Shift+1 { move-column-to-workspace 1; }
Mod+Shift+2 { move-column-to-workspace 2; }
Mod+Shift+3 { move-column-to-workspace 3; }
Mod+Shift+4 { move-column-to-workspace 4; }
Mod+Shift+5 { move-column-to-workspace 5; }
Mod+WheelScrollDown cooldown-ms=50 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=50 { focus-workspace-up; }
// }}}
}
// }}}