dots-of-war/eggs/niri/config.kdl

437 lines
14 KiB
Text
Raw Normal View History

2025-01-26 17:15:49 +01:00
// vim:set ft=kdl shiftwidth=4 commentstring=//%s:
2024-11-23 20:31:29 +01:00
input {
keyboard {
xkb {
layout "us"
options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
}
repeat-delay 280
repeat-rate 50
}
touchpad {
dwt
2024-12-09 13:35:23 +01:00
dwtp
2024-11-23 20:31:29 +01:00
tap
natural-scroll
// accel-speed 0.2
2024-12-15 11:25:23 +01:00
2024-12-09 13:35:23 +01:00
scroll-factor 0.7
2024-11-23 20:31:29 +01:00
}
mouse {
accel-speed -0.1
}
2024-12-09 13:35:23 +01:00
trackpoint {
accel-speed -0.1
}
2024-11-23 20:31:29 +01:00
//warp-mouse-to-focus
focus-follows-mouse max-scroll-amount="20%"
workspace-auto-back-and-forth
}
cursor {
2024-12-16 18:21:44 +01:00
xcursor-size 12 // {< rnum(if device.desktop { 32 } else { 12 }) >}
2024-11-23 20:31:29 +01:00
xcursor-theme "phinger-cursors-light"
2024-12-14 13:32:26 +01:00
hide-when-typing
2024-11-23 20:31:29 +01:00
}
environment {
DISPLAY ":0"
2025-02-06 16:54:46 +01:00
XDG_CURRENT_DESKTOP "niri"
XDG_SESSION_TYPE "wayland"
2024-11-23 20:31:29 +01:00
// GDK_BACKEND "x11"
}
2024-12-15 23:05:35 +01:00
output "Philips Consumer Electronics Company PHL 345B1C 0x00008E7C" {
mode "3440x1440@60"
scale 1
transform "normal"
2025-02-04 10:25:37 +01:00
// {% if device.desktop || SYSTEM.hostname == "kenbun-laptop-leon" %}
2024-12-15 23:05:35 +01:00
//<yolk> position x=2560 y=0
// {% else %}
position x=0 y=0
// {% end %}
}
2025-02-04 10:25:37 +01:00
// {% if device.desktop || SYSTEM.hostname == "kenbun-laptop-leon" %}
//<yolk> output "Fujitsu Siemens Computers GmbH P27-8 TE Pro YVBH008792" {
2024-12-15 23:05:35 +01:00
//<yolk> mode "2560x1440"
2024-12-12 15:53:46 +01:00
//<yolk> scale 1
//<yolk> position x=0 y=0
2025-01-26 17:15:49 +01:00
//<yolk> }
2025-02-04 10:25:37 +01:00
// {% end %}
2024-11-23 20:31:29 +01:00
2025-02-04 10:25:37 +01:00
// {% if device.thinkix || SYSTEM.hostname == "kenbun-laptop-leon" %}
2024-12-12 15:53:46 +01:00
//<yolk> output "eDP-1" {
2025-02-04 10:25:37 +01:00
//<yolk> mode "1920x1080@60"
//<yolk> scale 1.0
//<yolk> transform "normal"
//<yolk> position x=0 y=1440
2024-12-12 15:53:46 +01:00
//<yolk> }
2024-12-15 11:25:23 +01:00
// {% end %}
2024-12-09 13:35:23 +01:00
2024-11-23 20:31:29 +01:00
2024-12-09 13:35:23 +01:00
2024-12-15 23:05:35 +01:00
2024-11-23 20:31:29 +01:00
layout {
gaps 16
// center-focused-column "always" // - "never", "always" "on-overflow"
center-focused-column "on-overflow" // - "never", "always" "on-overflow"
2024-12-09 13:35:23 +01:00
// always-center-single-column
2024-11-23 20:31:29 +01:00
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
}
default-column-width { proportion 0.33333; }
focus-ring {
2024-12-15 23:05:35 +01:00
width 2 // {< rnum(if device.laptop {1} else {2})>}
2024-11-23 20:31:29 +01:00
active-color "#8ec07c"
inactive-color "#1d2021"
}
2025-02-04 10:25:37 +01:00
tab-indicator {
width 6
2025-02-06 16:54:46 +01:00
hide-when-single-tab
2025-02-04 10:25:37 +01:00
// inactive-color "red"
length total-proportion=0.8
active-color "#8ec07c"
inactive-color "#3c3836"
// inactive-color "#1d2021"
// inactive-gradient from="#1d2021" to="#3c3836"
}
2024-11-23 20:31:29 +01:00
}
2024-12-12 15:53:46 +01:00
2024-12-15 23:05:35 +01:00
// {% if device.laptop %}
2024-12-13 09:31:16 +01:00
//<yolk> spawn-at-startup "bash" "-c" "swayidle -w timeout 601 'niri msg action power-off-monitors' timeout 600 'hyprlock' before-sleep 'hyprlock' timeout 3600 'systemctl suspend' timeout 60000 'systemctl hibernate'"
2024-12-15 11:47:17 +01:00
//<yolk> spawn-at-startup "waybar"
2025-02-06 16:54:46 +01:00
//<yolk> spawn-at-startup "kanshi"
2024-12-15 11:47:17 +01:00
// {% end %}
2024-12-22 15:54:53 +01:00
// {% if device.desktop %}
//<yolk> spawn-at-startup "rm" "/home/elk/.config/google-chrome/SingletonLock"
// {% end %}
2024-11-23 20:31:29 +01:00
spawn-at-startup "bash" "-c" "eww -c ~/.config/eww-bar open-many bar_1 niri_scroller"
spawn-at-startup "xwayland-satellite"
2024-12-09 13:35:23 +01:00
spawn-at-startup "bash" "-c" "1password --silent"
2024-11-23 20:31:29 +01:00
spawn-at-startup "wl-paste" "--watch" "xclip -in -sel c"
spawn-at-startup "~/.config/niri/clipboardfix.sh"
2024-12-09 13:35:23 +01:00
spawn-at-startup "clipse -listen"
2024-11-23 20:31:29 +01:00
spawn-at-startup "wl-clip-persist" "--clipboard" "regular"
2024-12-09 13:35:23 +01:00
spawn-at-startup "kdeconnect-indicator"
//
2025-02-04 10:25:37 +01:00
spawn-at-startup "bash" "-c" "swaybg -m fill -i ~/.config/wallpapers/elk_gasstation_dark.jpg"
2024-12-09 13:35:23 +01:00
spawn-at-startup "~/.config/niri/clipsync watch with-notifications"
2024-12-15 11:25:23 +01:00
spawn-at-startup
2024-12-09 13:35:23 +01:00
//
2024-11-23 20:31:29 +01:00
prefer-no-csd
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
animations {
2024-12-15 11:47:17 +01:00
window-movement {
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
}
horizontal-view-movement {
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
}
2024-11-23 20:31:29 +01:00
window-open {
2024-12-15 11:47:17 +01:00
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
2024-11-23 20:31:29 +01:00
custom-shader r"
2025-01-26 17:17:11 +01:00
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
vec4 open_color(vec3 coords_geo, vec3 size_geo) {
float cur = niri_clamped_progress;
if (coords_geo.x > cur) { return vec4(0.0); }
vec3 coord = vec3(map(coords_geo.x,0.0, cur, 0.0, 1.0 ), coords_geo.y, coords_geo.z);
return texture2d(niri_tex, (niri_geo_to_tex * coord).st);
}
2024-11-23 20:31:29 +01:00
"
}
window-close {
2024-12-15 11:47:17 +01:00
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
2024-11-23 20:31:29 +01:00
custom-shader r"
2025-01-26 17:17:11 +01:00
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
vec4 close_color(vec3 coords_geo, vec3 size_geo) {
float cur = 1.0-niri_clamped_progress;
if (coords_geo.x > cur) { return vec4(0.0); }
vec3 coord = vec3(map(coords_geo.x,0.0, cur, 0.0, 1.0), coords_geo.y, coords_geo.z);
return texture2D(niri_tex, (niri_geo_to_tex * coord).st);
}
2024-11-23 20:31:29 +01:00
"
}
}
2025-02-11 10:13:28 +01:00
window-rule {
match is-window-cast-target=true
border {
on
active-color "#ff5555"
inactive-color "#ff5555"
width 2
}
}
2024-11-23 20:31:29 +01:00
window-rule {
match app-id=r#"^foot$"#
default-column-width { proportion 0.3333; }
}
2024-12-15 11:47:17 +01:00
layer-rule {
match namespace="^notifications$"
block-out-from "screen-capture"
}
2024-12-09 13:35:23 +01:00
2024-11-23 20:31:29 +01:00
window-rule {
match app-id=r#"1Password"#
2025-02-06 16:54:46 +01:00
match title="Open Folder"
2024-11-23 20:31:29 +01:00
match title=r#"[gG]mail"#
match title=r#".*[Ww]hats[aA]pp.*$"#
2025-01-26 17:15:49 +01:00
match title=r#".*Ente Photos.*"#
2024-11-23 20:31:29 +01:00
block-out-from "screen-capture"
}
2024-12-15 11:47:17 +01:00
window-rule {
match app-id=r#"^1Password$"#
2025-02-04 10:42:02 +01:00
match app-id=r#"msedge-_.*-Default"#
match title=r"[bB]itwarden"
match title=r#"^.* is sharing your screen.$"#;
2025-02-06 16:54:46 +01:00
match title="Open Folder"
2024-12-15 11:47:17 +01:00
open-floating true
}
2025-01-26 17:15:49 +01:00
2025-01-19 19:38:13 +01:00
window-rule {
match title=r#"Picture-in-Picture"#
max-width 300
open-floating true
}
2024-12-15 11:47:17 +01:00
2024-11-23 20:31:29 +01:00
window-rule {
match app-id=r#"^[gG]edit$"#;
match app-id=r#"^[eE]og$"#;
// fake-fullscreen true
}
2024-12-17 19:25:21 +01:00
2024-11-23 20:31:29 +01:00
window-rule {
2025-01-26 17:15:49 +01:00
shadow {
on
2025-01-26 19:54:01 +01:00
offset x=0 y=0
draw-behind-window true
2025-01-26 17:15:49 +01:00
}
2024-11-23 20:31:29 +01:00
clip-to-geometry true
geometry-corner-radius 8
}
2025-01-26 19:54:01 +01:00
window-rule {
match is-active=false
shadow {
softness 20
}
}
window-rule {
match is-active=true
shadow {
softness 10
}
}
2024-11-23 20:31:29 +01:00
binds {
Mod+Shift+Slash { show-hotkey-overlay; }
// Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+T { spawn "foot"; }
2025-02-04 10:25:37 +01:00
// {% if SYSTEM.hostname == "kenbun-laptop-leon" %}
//<yolk> Mod+B { spawn "bash" "-c" "unset DISPLAY && microsoft-edge --ozone-platform-hint=auto --enable-features=VaapiVideoDecodeLinuxGL --enable-features=TouchpadOverscrollHistoryNavigation"; }
// {% else %}
2024-12-09 13:35:23 +01:00
Mod+B { spawn "bash" "-c" "unset DISPLAY && google-chrome --ozone-platform-hint=auto --enable-features=VaapiVideoDecodeLinuxGL --enable-features=TouchpadOverscrollHistoryNavigation"; }
2025-02-04 10:25:37 +01:00
// {% end %}
2024-11-23 20:31:29 +01:00
Mod+Shift+P { spawn "~/.config/rofi/launchers/type-2/launcher.sh"; }
Mod+Shift+B { spawn "firefox"; }
// Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked.
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"; }
2024-12-09 13:35:23 +01:00
XF86MonBrightnessUp allow-when-locked=true { spawn "brightnessctl" "set" "5%+"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "brightnessctl" "set" "5%-"; }
2024-11-23 20:31:29 +01:00
Mod+Shift+Q { close-window; }
2025-02-04 10:25:37 +01:00
Mod+W { toggle-column-tabbed-display; }
2024-11-23 20:31:29 +01:00
Mod+H { focus-column-or-monitor-left; }
Mod+J { focus-window-down; }
Mod+K { focus-window-up; }
Mod+L { focus-column-or-monitor-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; }
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+Ctrl+H { focus-monitor-left; }
Mod+Ctrl+J { focus-monitor-down; }
Mod+Ctrl+K { focus-monitor-up; }
Mod+Ctrl+L { focus-monitor-right; }
Mod+Shift+Ctrl+H { move-window-to-monitor-left; }
Mod+Shift+Ctrl+J { move-window-to-monitor-down; }
Mod+Shift+Ctrl+K { move-window-to-monitor-up; }
Mod+Shift+Ctrl+L { move-window-to-monitor-right; }
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+U { focus-workspace-down; }
Mod+I { focus-workspace-up; }
//Mod+I { focus-workspace-up create-if-first=true; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Shift+U { move-column-to-workspace-down; }
Mod+Shift+I { move-column-to-workspace-up; }
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
Mod+Ctrl+U { move-workspace-down; }
Mod+Ctrl+I { move-workspace-up; }
2024-12-09 13:35:23 +01:00
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Ctrl+Shift+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Ctrl+Shift+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
2024-11-23 20:31:29 +01:00
// Mod+Ctrl+Shift+WheelScrollDown { scroll-viewport-left amount=0.1; }
// Mod+Ctrl+Shift+WheelScrollUp { scroll-viewport-right amount=0.1; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Ctrl+WheelScrollRight { move-column-right; }
Mod+Ctrl+WheelScrollLeft { move-column-left; }
Mod+WheelScrollDown { focus-column-right; }
Mod+WheelScrollUp { focus-column-left; }
// Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
// Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
// Similarly, you can bind touchpad scroll "ticks".
// Touchpad scrolling is continuous, so for these binds it is split into
// discrete intervals.
// These binds are also affected by touchpad's natural-scroll, so these
// example binds are "inverted", since we have natural-scroll enabled for
// touchpads by default.
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
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; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+1 { move-window-to-workspace 1; }
// Switches focus between the current and the previous workspace.
// Mod+Tab { focus-workspace-previous; }
Mod+Comma { consume-window-into-column; }
Mod+Period { consume-or-expel-window-right; }
//Mod+Period { expel-window-from-column; }
// There are also commands that consume or expel a single window to the side.
2025-01-26 17:15:49 +01:00
Mod+BracketLeft { consume-or-expel-window-left; }
Mod+BracketRight { consume-or-expel-window-right; }
2024-11-23 20:31:29 +01:00
Mod+R { switch-preset-column-width; }
2024-12-17 19:25:21 +01:00
Mod+Ctrl+R { spawn "sh" "-c" r#"
2024-12-21 22:42:30 +01:00
niri msg action focus-column-right
niri msg action set-column-width 33%
niri msg action focus-column-left
niri msg action set-column-width 67%
2025-01-26 17:15:49 +01:00
"#;
2024-12-17 19:25:21 +01:00
}
Mod+Ctrl+Shift+R { spawn "sh" "-c" r#"
2024-12-21 22:42:30 +01:00
niri msg action set-column-width 33%
niri msg action focus-column-right
niri msg action set-column-width 67%
niri msg action focus-column-left
2025-01-26 17:15:49 +01:00
"#;
2024-12-17 19:25:21 +01:00
}
Mod+Ctrl+T { spawn "sh" "-c" r#"
2024-12-21 22:42:30 +01:00
niri msg action set-column-width 50%
niri msg action focus-column-right
niri msg action set-column-width 50%
niri msg action focus-column-left
niri msg action focus-column-right
niri msg action focus-column-left
2025-01-26 17:15:49 +01:00
"#;
2024-12-17 19:25:21 +01:00
}
Mod+Ctrl+Shift+T { spawn "sh" "-c" r#"
2024-12-21 22:42:30 +01:00
niri msg action set-column-width 34%
niri msg action focus-column-right
niri msg action set-column-width 33%
niri msg action focus-column-right
niri msg action set-column-width 33%
niri msg action focus-column-left
niri msg action focus-column-left
2025-01-26 17:15:49 +01:00
"#;
2024-12-17 19:25:21 +01:00
}
2024-11-23 20:31:29 +01:00
Mod+Shift+R { reset-window-height; }
Mod+F { maximize-column; }
Mod+Shift+F { fullscreen-window; }
Mod+C { center-column; }
Mod+Minus { set-column-width "-10%"; }
Mod+Shift+Equal { set-column-width "+10%"; }
Mod+Equal { set-column-width "+10%"; }
Mod+Ctrl+Minus { set-window-height "-10%"; }
Mod+Ctrl+Equal { set-window-height "+10%"; }
Mod+Ctrl+Shift+Equal { set-window-height "+10%"; }
Mod+Shift+S { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
Mod+Shift+V { spawn "alacritty" "-e" "clipse"; }
Ctrl+Shift+Print {
spawn "sh" "-c" r#"
2025-01-26 17:15:49 +01:00
file=~/Videos/recordings/"$(date +%s)".mp4
wf-recorder -c h264_vaapi -r 60 --bframes 0 -g "$(slurp -b '#00000090' -w 0)" -f "$file"
wl-copy file:/"$file" -t text/uri-list
2024-11-23 20:31:29 +01:00
"#;
}
Ctrl+Escape { spawn "killall" "-s" "SIGINT" "wf-recorder"; }
Mod+Shift+E { quit; }
}