1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

fix: Matugen relative paths (#656)

* fix: Matugen relative paths

The Problem

All matugen config files (matugen/configs/*.toml) used relative paths like:

input_path = './matugen/templates/gtk-colors.css'

However, matugen was interpreting the relative paths ./matugen/templates/ as relative to its current execution context (which could be /tmp or another directory), not relative to $SHELL_DIR. This caused the "template doesn't exist" warnings and the "Failed to get input and output paths from hashmap" errors.

The Fix

Modified scripts/matugen-worker.sh to replace all relative template paths with absolute paths before passing them to matugen:

`sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g"`

* matugen: leave user-templates as-is

---------

Co-authored-by: bbedward <bbedward@gmail.com>
This commit is contained in:
Bruno Cesar Rocha
2025-11-07 18:58:19 +00:00
committed by GitHub
parent 35ead280d5
commit 86caf92c90

View File

@@ -122,7 +122,8 @@ build_once() {
echo "" >> "$TMP_CFG"
fi
grep -v '^\[config\]' "$SHELL_DIR/matugen/configs/base.toml" >> "$TMP_CFG"
grep -v '^\[config\]' "$SHELL_DIR/matugen/configs/base.toml" | \
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
cat >> "$TMP_CFG" << EOF
@@ -134,40 +135,48 @@ EOF
# If light mode, use gtk3 light config
if [[ "$mode" == "light" ]]; then
cat "$SHELL_DIR/matugen/configs/gtk3-light.toml" >> "$TMP_CFG"
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/gtk3-light.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
else
cat "$SHELL_DIR/matugen/configs/gtk3-dark.toml" >> "$TMP_CFG"
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/gtk3-dark.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v niri >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/niri.toml" >> "$TMP_CFG"
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/niri.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v qt5ct >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/qt5ct.toml" >> "$TMP_CFG"
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/qt5ct.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v qt6ct >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/qt6ct.toml" >> "$TMP_CFG"
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/qt6ct.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v firefox >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/firefox.toml" >> "$TMP_CFG"
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/firefox.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v pywalfox >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/pywalfox.toml" >> "$TMP_CFG"
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/pywalfox.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v vesktop >/dev/null 2>&1 && [[ -d "$CONFIG_DIR/vesktop" ]]; then
cat "$SHELL_DIR/matugen/configs/vesktop.toml" >> "$TMP_CFG"
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/vesktop.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi