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

matugen: fix shell path replacement

This commit is contained in:
bbedward
2025-11-09 10:29:09 -05:00
parent 1e5848e0d5
commit e0f2c03b91
17 changed files with 44 additions and 65 deletions

View File

@@ -1,3 +1,3 @@
[templates.dmsalacritty]
input_path = './matugen/templates/alacritty.toml'
input_path = 'SHELL_DIR/matugen/templates/alacritty.toml'
output_path = '~/.config/alacritty/dank-theme.toml'

View File

@@ -1,17 +1,17 @@
[config]
[templates.dmsgtk4]
input_path = './matugen/templates/gtk-colors.css'
input_path = 'SHELL_DIR/matugen/templates/gtk-colors.css'
output_path = '~/.config/gtk-4.0/dank-colors.css'
[templates.dmskcolorscheme]
input_path = './matugen/templates/kcolorscheme.colors'
input_path = 'SHELL_DIR/matugen/templates/kcolorscheme.colors'
output_path = '~/.local/share/color-schemes/DankMatugen.colors'
[templates.dmslightkcolorscheme]
input_path = './matugen/templates/light-kcolorscheme.colors'
input_path = 'SHELL_DIR/matugen/templates/light-kcolorscheme.colors'
output_path = '~/.local/share/color-schemes/DankMatugenLight.colors'
[templates.dmsdarkkcolorscheme]
input_path = './matugen/templates/dark-kcolorscheme.colors'
input_path = 'SHELL_DIR/matugen/templates/dark-kcolorscheme.colors'
output_path = '~/.local/share/color-schemes/DankMatugenDark.colors'

View File

@@ -1,13 +1,13 @@
[templates.dmscodiumdefault]
input_path = './matugen/templates/vscode-color-theme.json'
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme.json'
output_path = '~/.vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-default-base.json'
[templates.dmscodiumdark]
input_path = './matugen/templates/vscode-color-theme.json'
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme.json'
output_path = '~/.vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-dark-base.json'
mode = 'Dark'
[templates.dmscodiumlight]
input_path = './matugen/templates/vscode-color-theme.json'
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme.json'
output_path = '~/.vscode-oss/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-light-base.json'
mode = 'Light'

View File

@@ -1,3 +1,3 @@
[templates.dmsdgop]
input_path = './matugen/templates/dgop.json'
input_path = 'SHELL_DIR/matugen/templates/dgop.json'
output_path = '~/.config/dgop/colors.json'

View File

@@ -1,3 +1,3 @@
[templates.dmsfirefox]
input_path = './matugen/templates/firefox-userchrome.css'
input_path = 'SHELL_DIR/matugen/templates/firefox-userchrome.css'
output_path = '~/.config/DankMaterialShell/firefox.css'

View File

@@ -1,3 +1,3 @@
[templates.dmsfoot]
input_path = './matugen/templates/foot.ini'
input_path = 'SHELL_DIR/matugen/templates/foot.ini'
output_path = '~/.config/foot/dank-colors.ini'

View File

@@ -1,3 +1,3 @@
[templates.dmsghostty]
input_path = './matugen/templates/ghostty.conf'
input_path = 'SHELL_DIR/matugen/templates/ghostty.conf'
output_path = '~/.config/ghostty/config-dankcolors'

View File

@@ -1,3 +1,3 @@
[templates.dmsgtk3]
input_path = './matugen/templates/gtk-colors.css'
input_path = 'SHELL_DIR/matugen/templates/gtk-colors.css'
output_path = '~/.config/gtk-3.0/dank-colors.css'

View File

@@ -1,3 +1,3 @@
[templates.dmsgtk3]
input_path = './matugen/templates/gtk-light-colors.css'
input_path = 'SHELL_DIR/matugen/templates/gtk-light-colors.css'
output_path = '~/.config/gtk-3.0/dank-colors.css'

View File

@@ -1,7 +1,7 @@
[templates.dmskitty]
input_path = './matugen/templates/kitty.conf'
input_path = 'SHELL_DIR/matugen/templates/kitty.conf'
output_path = '~/.config/kitty/dank-theme.conf'
[templates.dmskittytabs]
input_path = './matugen/templates/kitty-tabs.conf'
input_path = 'SHELL_DIR/matugen/templates/kitty-tabs.conf'
output_path = '~/.config/kitty/dank-tabs.conf'

View File

@@ -1,3 +1,3 @@
[templates.dmsniri]
input_path = './matugen/templates/niri-colors.kdl'
input_path = 'SHELL_DIR/matugen/templates/niri-colors.kdl'
output_path = '~/.config/niri/dms/colors.kdl'

View File

@@ -1,4 +1,4 @@
[templates.dmspywalfox]
input_path = './matugen/templates/pywalfox-colors.json'
input_path = 'SHELL_DIR/matugen/templates/pywalfox-colors.json'
output_path = '~/.cache/wal/dank-pywalfox.json'
post_hook = 'command -v pywalfox && test -f ~/.cache/wal/colors.json && pywalfox update'

View File

@@ -1,3 +1,3 @@
[templates.dmsqt5ct]
input_path = './matugen/templates/qtct-colors.conf'
input_path = 'SHELL_DIR/matugen/templates/qtct-colors.conf'
output_path = '~/.config/qt5ct/colors/matugen.conf'

View File

@@ -1,3 +1,3 @@
[templates.dmsqt6ct]
input_path = './matugen/templates/qtct-colors.conf'
input_path = 'SHELL_DIR/matugen/templates/qtct-colors.conf'
output_path = '~/.config/qt6ct/colors/matugen.conf'

View File

@@ -1,3 +1,3 @@
[templates.dmsvesktop]
input_path = './matugen/templates/vesktop.css'
input_path = 'SHELL_DIR/matugen/templates/vesktop.css'
output_path = '~/.config/vesktop/themes/dank-discord.css'

View File

@@ -1,13 +1,13 @@
[templates.dmsvscodedefault]
input_path = './matugen/templates/vscode-color-theme.json'
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme.json'
output_path = '~/.vscode/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-default-base.json'
[templates.dmsvscodedark]
input_path = './matugen/templates/vscode-color-theme.json'
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme.json'
output_path = '~/.vscode/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-dark-base.json'
mode = 'Dark'
[templates.dmsvscodelight]
input_path = './matugen/templates/vscode-color-theme.json'
input_path = 'SHELL_DIR/matugen/templates/vscode-color-theme.json'
output_path = '~/.vscode/extensions/local.dynamic-base16-dankshell-0.0.1/themes/dankshell-light-base.json'
mode = 'Light'

View File

@@ -119,7 +119,7 @@ build_once() {
fi
grep -v '^\[config\]' "$SHELL_DIR/matugen/configs/base.toml" | \
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
cat >> "$TMP_CFG" << EOF
@@ -131,48 +131,40 @@ EOF
# If light mode, use gtk3 light config
if [[ "$mode" == "light" ]]; then
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/gtk3-light.toml" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/gtk3-light.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
else
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/gtk3-dark.toml" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/gtk3-dark.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v niri >/dev/null 2>&1; then
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/niri.toml" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/niri.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v qt5ct >/dev/null 2>&1; then
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/qt5ct.toml" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/qt5ct.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v qt6ct >/dev/null 2>&1; then
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/qt6ct.toml" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/qt6ct.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v firefox >/dev/null 2>&1; then
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/firefox.toml" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/firefox.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
if command -v pywalfox >/dev/null 2>&1; then
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/pywalfox.toml" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|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
sed "s|input_path = '\./matugen/templates/|input_path = '$SHELL_DIR/matugen/templates/|g" \
"$SHELL_DIR/matugen/configs/vesktop.toml" >> "$TMP_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/vesktop.toml" >> "$TMP_CFG"
echo "" >> "$TMP_CFG"
fi
@@ -211,37 +203,37 @@ EOF
echo "" >> "$TMP_CONTENT_CFG"
if command -v ghostty >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/ghostty.toml" >> "$TMP_CONTENT_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/ghostty.toml" >> "$TMP_CONTENT_CFG"
echo "" >> "$TMP_CONTENT_CFG"
fi
if command -v kitty >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/kitty.toml" >> "$TMP_CONTENT_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/kitty.toml" >> "$TMP_CONTENT_CFG"
echo "" >> "$TMP_CONTENT_CFG"
fi
if command -v foot >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/foot.toml" >> "$TMP_CONTENT_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/foot.toml" >> "$TMP_CONTENT_CFG"
echo "" >> "$TMP_CONTENT_CFG"
fi
if command -v alacritty >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/alacritty.toml" >> "$TMP_CONTENT_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/alacritty.toml" >> "$TMP_CONTENT_CFG"
echo "" >> "$TMP_CONTENT_CFG"
fi
if command -v dgop >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/dgop.toml" >> "$TMP_CONTENT_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/dgop.toml" >> "$TMP_CONTENT_CFG"
echo "" >> "$TMP_CONTENT_CFG"
fi
if command -v code >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/vscode.toml" >> "$TMP_CONTENT_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/vscode.toml" >> "$TMP_CONTENT_CFG"
echo "" >> "$TMP_CONTENT_CFG"
fi
if command -v codium >/dev/null 2>&1; then
cat "$SHELL_DIR/matugen/configs/codium.toml" >> "$TMP_CONTENT_CFG"
sed "s|'SHELL_DIR/|'$SHELL_DIR/|g" "$SHELL_DIR/matugen/configs/codium.toml" >> "$TMP_CONTENT_CFG"
echo "" >> "$TMP_CONTENT_CFG"
fi
@@ -298,10 +290,7 @@ EOF
if command -v ghostty >/dev/null 2>&1 && [[ -f "$CONFIG_DIR/ghostty/config-dankcolors" ]]; then
OUT=$(dms dank16 "$PRIMARY" $([[ "$mode" == "light" ]] && echo --light) ${SURFACE:+--background "$SURFACE"} --ghostty 2>/dev/null || true)
if [[ -n "${OUT:-}" ]]; then
TMP="$(mktemp)"
sed '/^palette = /d' "$CONFIG_DIR/ghostty/config-dankcolors" > "$TMP"
printf "\n%s\n" "$OUT" >> "$TMP"
mv "$TMP" "$CONFIG_DIR/ghostty/config-dankcolors"
printf "\n%s\n" "$OUT" >> "$CONFIG_DIR/ghostty/config-dankcolors"
if [[ -f "$CONFIG_DIR/ghostty/config" ]] && grep -q "^[^#]*config-dankcolors" "$CONFIG_DIR/ghostty/config" 2>/dev/null; then
pkill -USR2 -x 'ghostty|.ghostty-wrappe' >/dev/null 2>&1 || true
fi
@@ -311,10 +300,7 @@ EOF
if command -v kitty >/dev/null 2>&1 && [[ -f "$CONFIG_DIR/kitty/dank-theme.conf" ]]; then
OUT=$(dms dank16 "$PRIMARY" $([[ "$mode" == "light" ]] && echo --light) ${SURFACE:+--background "$SURFACE"} --kitty 2>/dev/null || true)
if [[ -n "${OUT:-}" ]]; then
TMP="$(mktemp)"
sed '/^color[0-9]/d' "$CONFIG_DIR/kitty/dank-theme.conf" > "$TMP"
printf "\n%s\n" "$OUT" >> "$TMP"
mv "$TMP" "$CONFIG_DIR/kitty/dank-theme.conf"
printf "\n%s\n" "$OUT" >> "$CONFIG_DIR/kitty/dank-theme.conf"
if [[ -f "$CONFIG_DIR/kitty/kitty.conf" ]] && grep -q "^[^#]*dank-theme.conf" "$CONFIG_DIR/kitty/kitty.conf" 2>/dev/null; then
pkill -USR1 -x kitty >/dev/null 2>&1 || true
fi
@@ -331,11 +317,7 @@ EOF
OUT=$(dms dank16 "$PRIMARY" $([[ "$mode" == "light" ]] && echo --light) ${SURFACE:+--background "$SURFACE"} --foot 2>/dev/null || true)
if [[ -n "${OUT:-}" ]]; then
TMP="$(mktemp)"
echo "[colors]" > "$TMP"
sed '/^regular[0-9]/d;/^bright[0-9]/d;/^\[colors\]/d' "$FOOT_CONFIG" >> "$TMP"
printf "\n%s\n" "$OUT" >> "$TMP"
mv "$TMP" "$FOOT_CONFIG"
printf "\n%s\n" "$OUT" >> "$FOOT_CONFIG"
fi
fi
@@ -349,10 +331,7 @@ EOF
OUT=$(dms dank16 "$PRIMARY" $([[ "$mode" == "light" ]] && echo --light) ${SURFACE:+--background "$SURFACE"} --alacritty 2>/dev/null || true)
if [[ -n "${OUT:-}" ]]; then
TMP="$(mktemp)"
sed '/^\[colors\.normal\]/,/^$/d;/^\[colors\.bright\]/,/^$/d' "$ALACRITTY_CONFIG" > "$TMP"
printf "\n%s\n" "$OUT" >> "$TMP"
mv "$TMP" "$ALACRITTY_CONFIG"
printf "\n%s\n" "$OUT" >> "$ALACRITTY_CONFIG"
fi
fi