nixos/frame12/linked-dotfiles/niri/config.kdl

400 lines
10 KiB
Plaintext

//
// MISCELLANEOUS
//
// gui startup
spawn-at-startup "waybar"
spawn-at-startup "keepassxc"
spawn-at-startup "flatpak" "run" "org.signal.Signal"
// shell startup
spawn-at-startup "swayosd-server" // volume and brightness display
spawn-sh-at-startup "kanshi"
spawn-sh-at-startup "sleep 5 && nm-applet --indicator"
spawn-sh-at-startup "sleep 5 && syncthingtray --wait"
spawn-sh-at-startup "sleep 5 && swaync"
screenshot-path null // save screenshots just to clipboard
prefer-no-csd // (Client Side Decorations) ask clients to not add their own decorations
hotkey-overlay {
skip-at-startup
}
//
// OUTPUTS
//
output "eDP-1"{
scale 1.0
variable-refresh-rate
transform "normal"
}
workspace "net"
workspace "term"
workspace "scratch"
//
// INPUTS
//
input {
keyboard {
xkb {
layout "us"
}
repeat-delay 175
repeat-rate 50
}
touchpad {
tap
dwt
dwtp
natural-scroll
accel-speed 0.2
accel-profile "adaptive"
}
mouse {
accel-speed 0.2
accel-profile "adaptive"
}
trackpoint {
accel-speed 0.2
accel-profile "adaptive"
}
tablet {
map-to-output "eDP-1"
}
touch {
map-to-output "eDP-1"
}
disable-power-key-handling
warp-mouse-to-focus mode="center-xy"
focus-follows-mouse
}
//
// LAYOUT
//
layout {
gaps 2
center-focused-column "on-overflow"
always-center-single-column
default-column-display "normal"
tab-indicator {
hide-when-single-tab
}
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
}
default-column-width {
proportion 0.5;
}
focus-ring {
width 0
}
border {
active-gradient from="#eaa4a8" to="#cbeaa6" angle=45 in="oklch longer hue" relative-to="workspace-view"
inactive-gradient from="#886D59" to="#517B65" angle=45 in="oklch longer hue" relative-to="workspace-view"
}
shadow {
softness 30
spread 5
offset x=8 y=8
draw-behind-window true
color "#00444444"
}
struts {
left 10
right 10
top 10
bottom 10
}
}
//
// WINDOW RULES
//
// All windows - corner radius, opacity
window-rule {
geometry-corner-radius 14 14 0 14
clip-to-geometry true
}
window-rule {
match is-active=true
opacity 0.99
}
window-rule {
match is-floating=true
opacity 0.92
}
// Term windows
window-rule {
match app-id="com.mitchellh.ghostty"
default-column-width { proportion 0.5; }
open-on-workspace "term"
}
// Net windows
window-rule {
match app-id="firefox"
default-column-width { proportion 1.0; }
open-on-workspace "net"
}
// Scratch windows (exclude unlock dialog so it can open on net)
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.signal\.Signal$"#
exclude app-id=r#"^org\.keepassxc\.KeePassXC$"# title="^Unlock Database - KeePassXC$"
block-out-from "screencast"
open-on-workspace "scratch"
}
// Keepass unlock dialog on Net workspace
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"# title="^Unlock Database - KeePassXC$"
open-floating true
open-focused true
open-on-workspace "net"
}
// File browser
window-rule {
match app-id="org.gnome.Nautilus"
open-floating true
}
// Bright border on screen-shared windows
window-rule {
match is-window-cast-target=true
focus-ring {
active-color "#f38ba8"
inactive-color "#7d0d2d"
}
border {
inactive-color "#7d0d2d"
}
shadow {
color "#7d0d2d70"
}
tab-indicator {
active-color "#f38ba8"
inactive-color "#7d0d2d"
}
}
// Block out notifications from screencasts.
layer-rule {
match namespace="^notifications$"
block-out-from "screencast"
}
//
// BINDS
//
binds {
Mod+Shift+Slash { show-hotkey-overlay; }
// Terminal - consistent with sway/hyprland
Mod+Return { spawn "ghostty"; }
// Application launcher - consistent with sway/hyprland
Mod+D { spawn "wofi" "--show" "drun"; }
// File manager - consistent with sway/hyprland
Mod+T { spawn "nautilus"; }
// Browser - consistent with sway/hyprland
Mod+W { spawn "firefox"; }
// Close window - consistent with sway/hyprland
Mod+Q { close-window; }
// Arrow keys for focus movement
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
// Colemak-DH keys - consistent with sway/hyprland (n=left, i=down, e=up, o=right)
Mod+N { focus-column-left; }
Mod+I { focus-window-down; }
Mod+E { focus-window-up; }
Mod+O { focus-column-right; }
// Arrow keys for window movement - consistent with sway/hyprland
Mod+Shift+Left { move-column-left; }
Mod+Shift+Down { move-window-down; }
Mod+Shift+Up { move-window-up; }
Mod+Shift+Right { move-column-right; }
// Colemak-DH keys for window movement - consistent with sway/hyprland
Mod+Shift+N { move-column-left; }
Mod+Shift+I { move-window-down; }
Mod+Shift+E { move-window-up; }
Mod+Shift+O { move-column-right; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
// Monitor focus (keeping existing Shift pattern since this conflicts with window movement)
Mod+Ctrl+Left { focus-monitor-left; }
Mod+Ctrl+Down { focus-monitor-down; }
Mod+Ctrl+Up { focus-monitor-up; }
Mod+Ctrl+Right { focus-monitor-right; }
// Colemak-DH keys for monitor focus
Mod+Ctrl+N { focus-monitor-left; }
Mod+Ctrl+I { focus-monitor-down; }
Mod+Ctrl+E { focus-monitor-up; }
Mod+Ctrl+O { focus-monitor-right; }
// Move column to monitor
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; }
// Colemak-DH keys for moving column to monitor
Mod+Shift+Ctrl+N { move-column-to-monitor-left; }
Mod+Shift+Ctrl+I { move-column-to-monitor-down; }
Mod+Shift+Ctrl+E { move-column-to-monitor-up; }
Mod+Shift+Ctrl+O { move-column-to-monitor-right; }
// Workspace navigation (using Page keys to avoid conflicts with Colemak-DH movement)
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
Mod+Minus { focus-workspace "scratch"; }
Mod+1 { focus-workspace "term"; }
Mod+2 { focus-workspace "net"; }
Mod+3 { focus-workspace "chat"; }
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+Shift+Minus { move-column-to-workspace "scratch"; }
Mod+Shift+1 { move-column-to-workspace "term"; }
Mod+Shift+2 { move-column-to-workspace "net"; }
Mod+Shift+3 { move-column-to-workspace "chat"; }
Mod+Shift+4 { move-column-to-workspace 4; }
Mod+Shift+5 { move-column-to-workspace 5; }
Mod+Shift+6 { move-column-to-workspace 6; }
Mod+Shift+7 { move-column-to-workspace 7; }
Mod+Shift+8 { move-column-to-workspace 8; }
Mod+Shift+9 { move-column-to-workspace 9; }
Mod+Comma { consume-window-into-column; }
Mod+Period { expel-window-from-column; }
Mod+R { switch-preset-column-width; }
Mod+Shift+R { reset-window-height; }
// Fullscreen - consistent with sway/hyprland
Mod+F { fullscreen-window; }
Mod+Shift+F { maximize-column; }
// Floating toggle
Mod+Space { toggle-window-floating; }
Mod+Shift+Space { switch-focus-between-floating-and-tiling; }
Mod+C { center-column; }
Mod+bracketleft { set-column-width "-10%"; }
Mod+bracketright { set-column-width "+10%"; }
Mod+Shift+bracketleft { set-window-height "-10%"; }
Mod+Shift+bracketright { set-window-height "+10%"; }
//
// Utilities
//
// Notifications
Mod+Shift+C { spawn-sh "swaync-client --toggle-panel"; }
// Screenshots - consistent with sway/hyprland
Mod+P { screenshot; }
Mod+Shift+P { screenshot-screen; }
// Traditional screenshot keys
Print { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
// Volume control (via swayosd)
XF86AudioRaiseVolume allow-when-locked=true { spawn "swayosd-client" "--output-volume" "raise"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "swayosd-client" "--output-volume" "lower"; }
XF86AudioMute allow-when-locked=true { spawn "swayosd-client" "--output-volume" "mute-toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn "swayosd-client" "--input-volume" "mute-toggle"; }
// Caps Lock indicator (via swayosd)
Caps_Lock { spawn "swayosd-client" "--caps-lock"; }
// Media control
XF86AudioPlay { spawn "playerctl" "play-pause"; }
XF86AudioPause { spawn "playerctl" "pause"; }
XF86AudioNext { spawn "playerctl" "next"; }
XF86AudioPrev { spawn "playerctl" "previous"; }
XF86AudioStop { spawn "playerctl" "stop"; }
// Brightness control (via swayosd)
XF86MonBrightnessUp { spawn "swayosd-client" "--brightness" "raise"; }
XF86MonBrightnessDown { spawn "swayosd-client" "--brightness" "lower"; }
// Screen rotation
Mod+Alt+Up { spawn "niri" "msg" "output" "eDP-1" "transform" "normal"; }
Mod+Alt+Right { spawn "niri" "msg" "output" "eDP-1" "transform" "90"; }
Mod+Alt+Down { spawn "niri" "msg" "output" "eDP-1" "transform" "180"; }
Mod+Alt+Left { spawn "niri" "msg" "output" "eDP-1" "transform" "270"; }
Mod+Shift+Q { quit; }
Mod+Shift+Ctrl+P { power-off-monitors; }
Mod+Shift+Ctrl+T { toggle-debug-tint; }
}
switch-events {
lid-close { spawn "systemctl" "suspend"; }
lid-open { spawn "notify-send" "The laptop lid is open!"; }
}