Restore themed Hyprland gradients

This commit is contained in:
Ryan Hughes
2026-06-01 17:37:24 -04:00
parent 5812a7d04a
commit 9c4ff68a43
10 changed files with 183 additions and 7 deletions
+14
View File
@@ -216,6 +216,7 @@ mkdir -p "$NEXT_THEME" "$CURRENT_THEME" "$USER_THEMED"
cat >"$NEXT_THEME/colors.toml" <<'EOF'
accent = "#336699"
hyprland_active_border = "rgba(010203ee) rgba(040506ee) 45deg"
cursor = "#ffffff"
foreground = "#ffffff"
background = "#000000"
@@ -245,12 +246,25 @@ strip={{ mix_strip background foreground 50% }}
rgb={{ mix_rgb background foreground 50% }}
EOF
cat >"$USER_THEMED/gradient-test.txt.tpl" <<'EOF'
hypr={{ hypr_gradient hyprland_active_border accent }}
shell={{ gradient_start hyprland_active_border accent }}
fallback-hypr={{ hypr_gradient missing accent }}
fallback-shell={{ gradient_start missing accent }}
EOF
OMARCHY_PATH="$ROOT" HOME="$PI_TMPDIR" "$ROOT/bin/omarchy-theme-set-templates"
grep -qx 'mix=#808080' "$NEXT_THEME/mix-test.txt" || fail "theme template mix helper works"
grep -qx 'strip=808080' "$NEXT_THEME/mix-test.txt" || fail "theme template mix_strip helper works"
grep -qx 'rgb=128,128,128' "$NEXT_THEME/mix-test.txt" || fail "theme template mix_rgb helper works"
pass "theme template color mix helpers work"
grep -qx 'hypr={ colors = { "rgba(010203ee)", "rgba(040506ee)" }, angle = 45 }' "$NEXT_THEME/gradient-test.txt" || fail "theme template hypr_gradient helper works"
grep -qx 'shell=#010203' "$NEXT_THEME/gradient-test.txt" || fail "theme template gradient_start helper works"
grep -qx 'fallback-hypr="#336699"' "$NEXT_THEME/gradient-test.txt" || fail "theme template hypr_gradient fallback works"
grep -qx 'fallback-shell=#336699' "$NEXT_THEME/gradient-test.txt" || fail "theme template gradient_start fallback works"
pass "theme template gradient helpers work"
jq -e '.name == "omarchy-system" and .vars.panel == "#0f0f0f" and .vars.border == "#4d4d4d" and .colors.accent == "accent"' "$NEXT_THEME/pi.json" >/dev/null
pass "pi theme template is generated from standard themed templates"
cp "$NEXT_THEME/pi.json" "$CURRENT_THEME/pi.json"