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 {
keyboard {
xkb {
}
}
touchpad {
tap
natural-scroll
}
mouse {
}
}
trackpoint {
}
}
output "DP-1" {
mode "2560x1440@169.900"
scale 1
transform "normal"
position x=0 y=0
}
output "eDP-1" {
mode "2560x1440@165.003"
scale 1.5
transform "normal"
position x=2560 y=0
}
layout {
gaps 16
center-focused-column "never"
@ -39,12 +35,11 @@ layout {
proportion 0.5
proportion 0.66667
}
// You can also customize the heights that "switch-preset-window-height" (Mod+Shift+R) toggles between.
// preset-window-heights { }
default-column-width {
default-column-width {}
}
// By default focus ring and border are rendered as a solid background rectangle
// behind windows. That is, they will show up through semitransparent windows.
// 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
// `draw-border-with-background`.
// You can change how the focus ring looks.
focus-ring {
// Uncomment this line to disable the focus ring.
// off
// How many logical pixels the ring extends out from the windows.
width 4
// Colors can be set in a variety of ways:
// - CSS named colors: "red"
// - RGB hex: "#rgb", "#rgba", "#rrggbb", "#rrggbbaa"
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
// Color of the ring on the active monitor.
active-color "#7fc8ff"
// Color of the ring on inactive monitors.
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).
// The angle is the same as in linear-gradient, and is optional,
// defaulting to 180 (top-to-bottom gradient).
@ -90,34 +79,30 @@ layout {
//
// 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.
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 4
active-color "#ffc87f"
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"
}
// 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.
// 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
// layer-shell panels and regular gaps.
struts {
// left 64
// left 64
// right 64
// top 64
// bottom 64
}
}
// Add lines like this to spawn processes at startup.
// Note that running niri as a session supports xdg-desktop-autostart,
// 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 "polkit-kde-agent"
spawn-at-startup "wl-paste" "--watch" "cliphist" "store"
// 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 "~/pic/screenshot%Y-%m-%d-%H-%M-%S.png"
// You can also set this to null to disable saving screenshots to disk.
// screenshot-path null
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
}
window-rule {
match app-id=r#"^org\.wezfurlong\.wezterm$"#
default-column-width {}
}
window-rule {
match app-id=r#"^org\.keepassxc\.KeePassXC$"#
match app-id=r#"^org\.gnome\.World\.Secrets$"#
match app-id="^org\\.wezfurlong\\.wezterm$"
default-column-width {
}
}
window-rule {
match app-id="^org\\.keepassxc\\.KeePassXC$"
match app-id="^org\\.gnome\\.World\\.Secrets$"
block-out-from "screen-capture"
}
window-rule {
draw-border-with-background false
}
// Example: enable rounded corners for all windows.
// (This example rule is commented out with a "/-" in front.)
/-window-rule {
geometry-corner-radius 12
clip-to-geometry true
geometry-corner-radius 12
clip-to-geometry true
}
binds {
Super+V { spawn "bash" "-c" "cliphist list | fuzzel --dmenu | cliphist decode | wl-copy"; }
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+Shift+Slash { show-hotkey-overlay; }
Mod+T { spawn "ghostty"; }
Mod+Space { spawn "fuzzel"; }
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"; }
Mod+Q { close-window; }
Mod+Left { focus-column-left; }
Mod+Down { focus-window-down; }
Mod+Up { focus-window-up; }
Mod+Right { focus-column-right; }
Mod+H { focus-column-left; }
Mod+J { focus-window-or-workspace-down; }
Mod+K { focus-window-or-workspace-up; }
Mod+L { focus-column-right; }
Mod+Shift+Left { move-column-left; }
Mod+Shift+Down { move-window-down; }
Mod+Shift+Up { move-window-up; }
Mod+Shift+Right { move-column-right; }
Mod+Shift+H { move-column-left; }
Mod+Shift+J { move-window-down-or-to-workspace-down; }
Mod+Shift+K { move-window-up-or-to-workspace-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+Left { focus-monitor-left; }
Mod+Ctrl+Down { focus-monitor-down; }
Mod+Ctrl+Up { focus-monitor-up; }
Mod+Ctrl+Right { focus-monitor-right; }
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+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+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; }
Super+V {
spawn "bash" "-c" "cliphist list | fuzzel --dmenu | cliphist decode | wl-copy"
}
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+Shift+Slash {
show-hotkey-overlay
}
Mod+T {
spawn "ghostty"
}
Mod+Space {
spawn "fuzzel"
}
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"
}
Mod+Q {
close-window
}
Mod+Left {
focus-column-left
}
Mod+Down {
focus-window-down
}
Mod+Up {
focus-window-up
}
Mod+Right {
focus-column-right
}
Mod+H {
focus-column-left
}
Mod+J {
focus-window-or-workspace-down
}
Mod+K {
focus-window-or-workspace-up
}
Mod+L {
focus-column-right
}
Mod+Shift+Left {
move-column-left
}
Mod+Shift+Down {
move-window-down
}
Mod+Shift+Up {
move-window-up
}
Mod+Shift+Right {
move-column-right
}
Mod+Shift+H {
move-column-left
}
Mod+Shift+J {
move-window-down-or-to-workspace-down
}
Mod+Shift+K {
move-window-up-or-to-workspace-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+Left {
focus-monitor-left
}
Mod+Ctrl+Down {
focus-monitor-down
}
Mod+Ctrl+Up {
focus-monitor-up
}
Mod+Ctrl+Right {
focus-monitor-right
}
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+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+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 = [
{
name = "kdl";
formatter = {
command = "kdlfmt";
args = [
"format"
"-"
];
};
}
{
name = "just";
formatter = {

View file

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