add kdlfmt as kdl formatter for helix, and format config.kdl

This commit is contained in:
ulic-youthlic 2025-01-25 17:14:03 +08:00
parent 40f486c373
commit 9b30452dd7
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
3 changed files with 328 additions and 160 deletions

View file

@ -1,36 +1,32 @@
input { input {
keyboard { keyboard {
xkb { xkb {
} }
} }
touchpad { touchpad {
tap tap
natural-scroll natural-scroll
} }
mouse { mouse {
}
}
trackpoint { trackpoint {
} }
} }
output "DP-1" { output "DP-1" {
mode "2560x1440@169.900" mode "2560x1440@169.900"
scale 1 scale 1
transform "normal" transform "normal"
position x=0 y=0 position x=0 y=0
} }
output "eDP-1" { output "eDP-1" {
mode "2560x1440@165.003" mode "2560x1440@165.003"
scale 1.5 scale 1.5
transform "normal" transform "normal"
position x=2560 y=0 position x=2560 y=0
} }
layout { layout {
gaps 16 gaps 16
center-focused-column "never" center-focused-column "never"
@ -39,12 +35,11 @@ layout {
proportion 0.5 proportion 0.5
proportion 0.66667 proportion 0.66667
} }
// You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between. // You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
// preset-window-heights { } // preset-window-heights { }
default-column-width {
default-column-width {} }
// By default focus ring and border are rendered as a solid background rectangle // By default focus ring and border are rendered as a solid background rectangle
// behind windows. That is, they will show up through semitransparent windows. // behind windows. That is, they will show up through semitransparent windows.
// This is because windows using client-side decorations can have an arbitrary shape. // This is because windows using client-side decorations can have an arbitrary shape.
@ -55,27 +50,21 @@ layout {
// //
// Alternatively, you can override it with a window rule called // Alternatively, you can override it with a window rule called
// `draw-border-with-background`. // `draw-border-with-background`.
// You can change how the focus ring looks. // You can change how the focus ring looks.
focus-ring { focus-ring {
// Uncomment this line to disable the focus ring. // Uncomment this line to disable the focus ring.
// off // off
// How many logical pixels the ring extends out from the windows. // How many logical pixels the ring extends out from the windows.
width 4 width 4
// Colors can be set in a variety of ways: // Colors can be set in a variety of ways:
// - CSS named colors: "red" // - CSS named colors: "red"
// - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa" // - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others. // - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
// Color of the ring on the active monitor. // Color of the ring on the active monitor.
active-color "#7fc8ff" active-color "#7fc8ff"
// Color of the ring on inactive monitors. // Color of the ring on inactive monitors.
inactive-color "#505050" inactive-color "#505050"
// You can also use gradients. They take precedence over solid colors.
// You can also use gradients. They take precedence over solid colors.
// Gradients are rendered the same as CSS linear-gradient(angle, from, to). // Gradients are rendered the same as CSS linear-gradient(angle, from, to).
// The angle is the same as in linear-gradient, and is optional, // The angle is the same as in linear-gradient, and is optional,
// defaulting to 180 (top-to-bottom gradient). // defaulting to 180 (top-to-bottom gradient).
@ -90,34 +79,30 @@ layout {
// //
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
} }
// You can also add a border. It's similar to the focus ring, but always visible. // You can also add a border. It's similar to the focus ring, but always visible.
border { border {
// The settings are the same as for the focus ring. // The settings are the same as for the focus ring.
// If you enable the border, you probably want to disable the focus ring. // If you enable the border, you probably want to disable the focus ring.
off off
width 4 width 4
active-color "#ffc87f" active-color "#ffc87f"
inactive-color "#505050" inactive-color "#505050"
// active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
// active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view"
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
} }
// Struts shrink the area occupied by windows, similarly to layer-shell panels. // Struts shrink the area occupied by windows, similarly to layer-shell panels.
// You can think of them as a kind of outer gaps. They are set in logical pixels. // You can think of them as a kind of outer gaps. They are set in logical pixels.
// Left and right struts will cause the next window to the side to always be visible. // Left and right struts will cause the next window to the side to always be visible.
// Top and bottom struts will simply add outer gaps in addition to the area occupied by // Top and bottom struts will simply add outer gaps in addition to the area occupied by
// layer-shell panels and regular gaps. // layer-shell panels and regular gaps.
struts { struts {
// left 64 // left 64
// right 64 // right 64
// top 64 // top 64
// bottom 64 // bottom 64
} }
} }
// Add lines like this to spawn processes at startup. // Add lines like this to spawn processes at startup.
// Note that running niri as a session supports xdg-desktop-autostart, // Note that running niri as a session supports xdg-desktop-autostart,
// which may be more convenient to use. // which may be more convenient to use.
@ -132,165 +117,337 @@ spawn-at-startup "fcitx5" "-d" "--replace"
spawn-at-startup "xwayland-satellite" ":1" spawn-at-startup "xwayland-satellite" ":1"
spawn-at-startup "polkit-kde-agent" spawn-at-startup "polkit-kde-agent"
spawn-at-startup "wl-paste" "--watch" "cliphist" "store" spawn-at-startup "wl-paste" "--watch" "cliphist" "store"
// Uncomment this line to ask the clients to omit their client-side decorations if possible. // 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. // 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. // 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. // 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. // After enabling or disabling this, you need to restart the apps for this to take effect.
// prefer-no-csd // prefer-no-csd
screenshot-path "~/pic/screenshot%Y-%m-%d-%H-%M-%S.png" screenshot-path "~/pic/screenshot%Y-%m-%d-%H-%M-%S.png"
// You can also set this to null to disable saving screenshots to disk. // You can also set this to null to disable saving screenshots to disk.
// screenshot-path null // screenshot-path null
animations { animations {
// Slow down all animations by this factor. Values below 1 speed them up instead. // Slow down all animations by this factor. Values below 1 speed them up instead.
// slowdown 3.0 // slowdown 3.0
}
window-rule {
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
} }
window-rule { window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"# match app-id="^org\\.wezfurlong\\.wezterm$"
match app-id=r#"^org\.gnome\.World\.Secrets$"# default-column-width {
}
}
window-rule {
match app-id="^org\\.keepassxc\\.KeePassXC$"
match app-id="^org\\.gnome\\.World\\.Secrets$"
block-out-from "screen-capture" block-out-from "screen-capture"
} }
window-rule { window-rule {
draw-border-with-background false draw-border-with-background false
} }
// Example: enable rounded corners for all windows. // Example: enable rounded corners for all windows.
// (This example rule is commented out with a "/-" in front.) // (This example rule is commented out with a "/-" in front.)
/-window-rule { /-window-rule {
geometry-corner-radius 12 geometry-corner-radius 12
clip-to-geometry true clip-to-geometry true
} }
binds { binds {
Super+V { spawn "bash" "-c" "cliphist list | fuzzel --dmenu | cliphist decode | wl-copy"; } Super+V {
Super+Shift+L { spawn "bash" "-c" "swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 7 --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.5"; } spawn "bash" "-c" "cliphist list | fuzzel --dmenu | cliphist decode | wl-copy"
}
Mod+Shift+Slash { show-hotkey-overlay; } Super+Shift+L {
spawn "bash" "-c" "swaylock --screenshots --clock --indicator --indicator-radius 100 --indicator-thickness 7 --effect-blur 7x5 --effect-vignette 0.5:0.5 --grace 2 --fade-in 0.5"
Mod+T { spawn "ghostty"; } }
Mod+Space { spawn "fuzzel"; } Mod+Shift+Slash {
show-hotkey-overlay
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-"; } Mod+T {
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } spawn "ghostty"
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } }
Mod+Space {
Mod+Q { close-window; } spawn "fuzzel"
}
Mod+Left { focus-column-left; } XF86AudioRaiseVolume allow-when-locked=true {
Mod+Down { focus-window-down; } spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"
Mod+Up { focus-window-up; } }
Mod+Right { focus-column-right; } XF86AudioLowerVolume allow-when-locked=true {
Mod+H { focus-column-left; } spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"
Mod+J { focus-window-or-workspace-down; } }
Mod+K { focus-window-or-workspace-up; } XF86AudioMute allow-when-locked=true {
Mod+L { focus-column-right; } spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"
}
Mod+Shift+Left { move-column-left; } XF86AudioMicMute allow-when-locked=true {
Mod+Shift+Down { move-window-down; } spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"
Mod+Shift+Up { move-window-up; } }
Mod+Shift+Right { move-column-right; } Mod+Q {
Mod+Shift+H { move-column-left; } close-window
Mod+Shift+J { move-window-down-or-to-workspace-down; } }
Mod+Shift+K { move-window-up-or-to-workspace-up; } Mod+Left {
Mod+Shift+L { move-column-right; } focus-column-left
}
Mod+Home { focus-column-first; } Mod+Down {
Mod+End { focus-column-last; } focus-window-down
Mod+Ctrl+Home { move-column-to-first; } }
Mod+Ctrl+End { move-column-to-last; } Mod+Up {
focus-window-up
Mod+Ctrl+Left { focus-monitor-left; } }
Mod+Ctrl+Down { focus-monitor-down; } Mod+Right {
Mod+Ctrl+Up { focus-monitor-up; } focus-column-right
Mod+Ctrl+Right { focus-monitor-right; } }
Mod+Ctrl+H { focus-monitor-left; } Mod+H {
Mod+Ctrl+J { focus-monitor-down; } focus-column-left
Mod+Ctrl+K { focus-monitor-up; } }
Mod+Ctrl+L { focus-monitor-right; } Mod+J {
focus-window-or-workspace-down
Mod+Shift+Ctrl+Left { move-column-to-monitor-left; } }
Mod+Shift+Ctrl+Down { move-column-to-monitor-down; } Mod+K {
Mod+Shift+Ctrl+Up { move-column-to-monitor-up; } focus-window-or-workspace-up
Mod+Shift+Ctrl+Right { move-column-to-monitor-right; } }
Mod+Shift+Ctrl+H { move-column-to-monitor-left; } Mod+L {
Mod+Shift+Ctrl+J { move-column-to-monitor-down; } focus-column-right
Mod+Shift+Ctrl+K { move-column-to-monitor-up; } }
Mod+Shift+Ctrl+L { move-column-to-monitor-right; } Mod+Shift+Left {
move-column-left
Mod+Page_Down { focus-workspace-down; } }
Mod+Page_Up { focus-workspace-up; } Mod+Shift+Down {
Mod+U { focus-workspace-down; } move-window-down
Mod+I { focus-workspace-up; } }
Mod+Shift+Page_Down { move-column-to-workspace-down; } Mod+Shift+Up {
Mod+Shift+Page_Up { move-column-to-workspace-up; } move-window-up
Mod+Shift+U { move-column-to-workspace-down; } }
Mod+Shift+I { move-column-to-workspace-up; } Mod+Shift+Right {
move-column-right
Mod+Ctrl+Page_Down { move-workspace-down; } }
Mod+Ctrl+Page_Up { move-workspace-up; } Mod+Shift+H {
Mod+Ctrl+U { move-workspace-down; } move-column-left
Mod+Ctrl+I { move-workspace-up; } }
Mod+Shift+J {
Mod+Shift+WheelScrollDown cooldown-ms=150 { focus-workspace-down; } move-window-down-or-to-workspace-down
Mod+Shift+WheelScrollUp cooldown-ms=150 { focus-workspace-up; } }
Mod+WheelScrollDown { focus-column-right; } Mod+Shift+K {
Mod+WheelScrollUp { focus-column-left; } move-window-up-or-to-workspace-up
}
Mod+1 { focus-workspace 1; } Mod+Shift+L {
Mod+2 { focus-workspace 2; } move-column-right
Mod+3 { focus-workspace 3; } }
Mod+4 { focus-workspace 4; } Mod+Home {
Mod+5 { focus-workspace 5; } focus-column-first
Mod+6 { focus-workspace 6; } }
Mod+7 { focus-workspace 7; } Mod+End {
Mod+8 { focus-workspace 8; } focus-column-last
Mod+9 { focus-workspace 9; } }
Mod+Shift+1 { move-column-to-workspace 1; } Mod+Ctrl+Home {
Mod+Shift+2 { move-column-to-workspace 2; } move-column-to-first
Mod+Shift+3 { move-column-to-workspace 3; } }
Mod+Shift+4 { move-column-to-workspace 4; } Mod+Ctrl+End {
Mod+Shift+5 { move-column-to-workspace 5; } move-column-to-last
Mod+Shift+6 { move-column-to-workspace 6; } }
Mod+Shift+7 { move-column-to-workspace 7; } Mod+Ctrl+Left {
Mod+Shift+8 { move-column-to-workspace 8; } focus-monitor-left
Mod+Shift+9 { move-column-to-workspace 9; } }
Mod+Ctrl+Down {
Mod+Tab { focus-workspace-previous; } focus-monitor-down
}
Mod+BracketLeft { consume-or-expel-window-left; } Mod+Ctrl+Up {
Mod+BracketRight { consume-or-expel-window-right; } focus-monitor-up
}
Mod+Comma { consume-window-into-column; } Mod+Ctrl+Right {
focus-monitor-right
Mod+Period { expel-window-from-column; } }
Mod+Ctrl+H {
Mod+R { switch-preset-column-width; } focus-monitor-left
Mod+Shift+R { switch-preset-window-height; } }
Mod+Ctrl+R { reset-window-height; } Mod+Ctrl+J {
Mod+M { maximize-column; } focus-monitor-down
Mod+Shift+M { fullscreen-window; } }
Mod+Z { center-column; } Mod+Ctrl+K {
focus-monitor-up
Mod+Minus { set-column-width "-10%"; } }
Mod+Equal { set-column-width "+10%"; } Mod+Ctrl+L {
focus-monitor-right
Mod+Shift+Minus { set-window-height "-10%"; } }
Mod+Shift+Equal { set-window-height "+10%"; } Mod+Shift+Ctrl+Left {
move-column-to-monitor-left
Print { screenshot; } }
Ctrl+Print { screenshot-screen; } Mod+Shift+Ctrl+Down {
Alt+Print { screenshot-window; } move-column-to-monitor-down
}
Mod+Shift+E { quit; } Mod+Shift+Ctrl+Up {
move-column-to-monitor-up
}
Mod+Shift+Ctrl+Right {
move-column-to-monitor-right
}
Mod+Shift+Ctrl+H {
move-column-to-monitor-left
}
Mod+Shift+Ctrl+J {
move-column-to-monitor-down
}
Mod+Shift+Ctrl+K {
move-column-to-monitor-up
}
Mod+Shift+Ctrl+L {
move-column-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+Shift+Page_Down {
move-column-to-workspace-down
}
Mod+Shift+Page_Up {
move-column-to-workspace-up
}
Mod+Shift+U {
move-column-to-workspace-down
}
Mod+Shift+I {
move-column-to-workspace-up
}
Mod+Ctrl+Page_Down {
move-workspace-down
}
Mod+Ctrl+Page_Up {
move-workspace-up
}
Mod+Ctrl+U {
move-workspace-down
}
Mod+Ctrl+I {
move-workspace-up
}
Mod+Shift+WheelScrollDown cooldown-ms=150 {
focus-workspace-down
}
Mod+Shift+WheelScrollUp cooldown-ms=150 {
focus-workspace-up
}
Mod+WheelScrollDown {
focus-column-right
}
Mod+WheelScrollUp {
focus-column-left
}
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+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+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+Tab {
focus-workspace-previous
}
Mod+BracketLeft {
consume-or-expel-window-left
}
Mod+BracketRight {
consume-or-expel-window-right
}
Mod+Comma {
consume-window-into-column
}
Mod+Period {
expel-window-from-column
}
Mod+R {
switch-preset-column-width
}
Mod+Shift+R {
switch-preset-window-height
}
Mod+Ctrl+R {
reset-window-height
}
Mod+M {
maximize-column
}
Mod+Shift+M {
fullscreen-window
}
Mod+Z {
center-column
}
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%"
}
Print {
screenshot
}
Ctrl+Print {
screenshot-screen
}
Alt+Print {
screenshot-window
}
Mod+Shift+E {
quit
}
} }

View file

@ -48,6 +48,16 @@
}; };
}; };
language = [ language = [
{
name = "kdl";
formatter = {
command = "kdlfmt";
args = [
"format"
"-"
];
};
}
{ {
name = "just"; name = "just";
formatter = { formatter = {

View file

@ -9,6 +9,7 @@ let
runtimeInputs = ( runtimeInputs = (
with pkgs; with pkgs;
[ [
kdlfmt
rustfmt rustfmt
clang-tools clang-tools
libxml2 libxml2