1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

matugen: more flexible checking

This commit is contained in:
bbedward
2025-11-01 11:49:12 -04:00
parent 9a9e62ccd3
commit 89d54dedb7

View File

@@ -279,7 +279,7 @@ EOF
gsettings set org.gnome.desktop.interface gtk-theme "adw-gtk3-${mode}" >/dev/null 2>&1 || true
fi
if echo "$JSON" | grep -q "\"colors\":{\"dark\":{"; then
if echo "$JSON" | grep -qE "\"colors\":\{\"(dark|light)\":\{"; then
PRIMARY=$(echo "$JSON" | sed -n "s/.*\"$mode\":{[^}]*\"primary_container\":\"\\(#[0-9a-fA-F]\\{6\\}\\)\".*/\\1/p")
HONOR=$(echo "$JSON" | sed -n "s/.*\"$mode\":{[^}]*\"primary\":\"\\(#[0-9a-fA-F]\\{6\\}\\)\".*/\\1/p")
SURFACE=$(echo "$JSON" | sed -n "s/.*\"$mode\":{[^}]*\"surface\":\"\\(#[0-9a-fA-F]\\{6\\}\\)\".*/\\1/p")