From d9a91d6cef843c0a14017a53a5b429475c87d8d5 Mon Sep 17 00:00:00 2001 From: "nacho :3" Date: Tue, 21 Jul 2026 22:45:44 +0200 Subject: [PATCH] fix(hyprland): generate inactive border gradients in Lua --- pkg/ipc/hyprland/generator_lua.go | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/pkg/ipc/hyprland/generator_lua.go b/pkg/ipc/hyprland/generator_lua.go index 8ebad9f..f3d2a37 100644 --- a/pkg/ipc/hyprland/generator_lua.go +++ b/pkg/ipc/hyprland/generator_lua.go @@ -67,9 +67,29 @@ func (g *LuaGenerator) GenerateAppearanceLua(config ipc.ConfigAppearance) string } } if hasInactive { - colors, _ := parseColorString(*config.Border.InactiveColor) + colors, angle := parseColorString(*config.Border.InactiveColor) if colors != "" { - b.WriteString(fmt.Sprintf(" inactive_border = \"%s\",\n", strings.TrimSuffix(colors, " "))) + if angle != "" { + angleNum := strings.TrimSuffix(angle, "deg") + colorParts := strings.Fields(colors) + quoted := make([]string, len(colorParts)) + + for i, cp := range colorParts { + quoted[i] = fmt.Sprintf("%q", cp) + } + + colorList := strings.Join(quoted, ", ") + b.WriteString(fmt.Sprintf( + " inactive_border = { colors = {%s}, angle = %s },\n", + colorList, + angleNum, + )) + } else { + b.WriteString(fmt.Sprintf( + " inactive_border = \"%s\",\n", + colors, + )) + } } } b.WriteString(" },\n")