lib: make toHyprconf support strings and attrs in sections

Adds support for

    section = [
      "abc"
      { a = 123; }
    ];

Which gets generated to

    section=abc

    section {
      a=123
    }

This is very useful with the new windowrule syntax, where you can
create anonymous window rules as strings and named rules as attribute
sets. See <https://wiki.hypr.land/Configuring/Window-Rules/>.
This commit is contained in:
PerchunPak 2026-01-02 08:58:42 +01:00 committed by Robert Helgesson
parent e4e78a2cbe
commit d4e4d5cfa3
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
9 changed files with 197 additions and 22 deletions

View file

@ -13,6 +13,10 @@ animations {
enabled=true
}
bindm=$mod, mouse:272, movewindow
bindm=$mod, mouse:273, resizewindow
bindm=$mod ALT, mouse:272, resizewindow
decoration {
col.shadow=rgba(00000099)
shadow_offset=0 5
@ -45,9 +49,6 @@ plugin {
dummy=plugin setting
}
}
bindm=$mod, mouse:272, movewindow
bindm=$mod, mouse:273, resizewindow
bindm=$mod ALT, mouse:272, resizewindow
# window resize
bind = $mod, S, submap, resize

View file

@ -13,6 +13,10 @@ animations {
enabled=true
}
bindm=$mod, mouse:272, movewindow
bindm=$mod, mouse:273, resizewindow
bindm=$mod ALT, mouse:272, resizewindow
decoration {
col.shadow=rgba(00000099)
shadow_offset=0 5
@ -48,9 +52,6 @@ plugin {
dummy=plugin setting
}
}
bindm=$mod, mouse:272, movewindow
bindm=$mod, mouse:273, resizewindow
bindm=$mod ALT, mouse:272, resizewindow
# window resize
bind = $mod, S, submap, resize

View file

@ -10,4 +10,5 @@ input {
follow_mouse=1
kb_layout=ro
}
source=sourced.conf

View file

@ -17,6 +17,7 @@ submap = reset
submap = resize
bind=, escape, submap, reset
bind=, return, submap, reset
binde=, right, resizeactive, 10 0
binde=, left, resizeactive, -10 0
binde=, up, resizeactive, 0 -10

View file

@ -1,7 +1,8 @@
ipc=on
preload=/share/wallpapers/buttons.png
preload=/share/wallpapers/cat_pacman.png
splash=false
splash_offset=2.000000
wallpaper=DP-3,/share/wallpapers/buttons.png
wallpaper=DP-1,/share/wallpapers/cat_pacman.png
ipc=on
splash=false
splash_offset=2.000000