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

Allow user's matugen config to be ran by dms (#328)

* Allow user's matugen config to be ran by dms

matugen-workers.sh now also loads the configs and templates from `~/.config/matugen/dms` and handles them the same way dms does its own matugen configs.

* Do not auto create user's matugen directories
This commit is contained in:
Nek
2025-10-06 14:33:44 -10:00
committed by GitHub
parent 7158e09b0e
commit 71b96efca0

View File

@@ -68,7 +68,8 @@ build_once() {
[[ -z "$surface_base" ]] && surface_base="sc" [[ -z "$surface_base" ]] && surface_base="sc"
CONFIG_DIR="${CONFIG_DIR:-$HOME/.config}" CONFIG_DIR="${CONFIG_DIR:-$HOME/.config}"
USER_MATUGEN_DIR="$CONFIG_DIR/matugen/dms"
TMP_CFG="$(mktemp)" TMP_CFG="$(mktemp)"
trap 'rm -f "$TMP_CFG"' RETURN trap 'rm -f "$TMP_CFG"' RETURN
@@ -113,6 +114,13 @@ EOF
echo "" >> "$TMP_CFG" echo "" >> "$TMP_CFG"
fi fi
# Load user's matugen configurations
for config in "$USER_MATUGEN_DIR/configs"/*.toml; do
[[ -f "$config" ]] || continue
cat "$config" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
done
# GTK3 colors based on colloid # GTK3 colors based on colloid
COLLOID_TEMPLATE="$SHELL_DIR/matugen/templates/gtk3-colors.css" COLLOID_TEMPLATE="$SHELL_DIR/matugen/templates/gtk3-colors.css"
@@ -125,7 +133,8 @@ EOF
trap 'rm -rf "$TMP_TEMPLATES_DIR"' RETURN trap 'rm -rf "$TMP_TEMPLATES_DIR"' RETURN
# Create shifted versions of templates # Create shifted versions of templates
for template in "$SHELL_DIR/matugen/templates"/*.{css,conf,json,kdl,colors}; do for template in "$SHELL_DIR/matugen/templates"/*.{css,conf,json,kdl,colors} \
"$USER_MATUGEN_DIR/templates"/*.{css,conf,json,kdl,colors,toml}; do
[[ -f "$template" ]] || continue [[ -f "$template" ]] || continue
template_name="$(basename "$template")" template_name="$(basename "$template")"
shifted_template="$TMP_TEMPLATES_DIR/$template_name" shifted_template="$TMP_TEMPLATES_DIR/$template_name"
@@ -140,6 +149,7 @@ EOF
# Update config to use shifted templates # Update config to use shifted templates
sed -i "s|input_path = '$SHELL_DIR/matugen/templates/|input_path = '$TMP_TEMPLATES_DIR/|g" "$TMP_CFG" sed -i "s|input_path = '$SHELL_DIR/matugen/templates/|input_path = '$TMP_TEMPLATES_DIR/|g" "$TMP_CFG"
sed -i "s|input_path = '$USER_MATUGEN_DIR/templates/|input_path = '$TMP_TEMPLATES_DIR/|g" "$TMP_CFG"
# Handle the special colloid template path # Handle the special colloid template path
if [[ -f "$TMP_TEMPLATES_DIR/gtk3-colors.css" ]]; then if [[ -f "$TMP_TEMPLATES_DIR/gtk3-colors.css" ]]; then
@@ -274,4 +284,4 @@ while :; do
fi fi
done done
exit 0 exit 0