mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
use a matugen template for dms-colors.json
This commit is contained in:
3
matugen/configs/dank.toml
Normal file
3
matugen/configs/dank.toml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[templates.dank]
|
||||||
|
input_path = './matugen/templates/dank.json'
|
||||||
|
output_path = '~/.cache/quickshell/dankshell/dms-colors.json'
|
||||||
10
matugen/templates/dank.json
Normal file
10
matugen/templates/dank.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"colors": {
|
||||||
|
"dark": {<* for name, value in colors *>
|
||||||
|
"{{name}}": "{{value.dark.hex}}"<* if not loop.last *>,<* endif *><* endfor *>
|
||||||
|
},
|
||||||
|
"light": {<* for name, value in colors *>
|
||||||
|
"{{name}}": "{{value.light.hex}}"<* if not loop.last *>,<* endif *><* endfor *>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -74,16 +74,21 @@ build_once() {
|
|||||||
|
|
||||||
cat "$SHELL_DIR/matugen/configs/base.toml" > "$TMP_CFG"
|
cat "$SHELL_DIR/matugen/configs/base.toml" > "$TMP_CFG"
|
||||||
echo "" >> "$TMP_CFG"
|
echo "" >> "$TMP_CFG"
|
||||||
|
|
||||||
|
# Always include dank config for dms-colors.json
|
||||||
|
cat "$SHELL_DIR/matugen/configs/dank.toml" >> "$TMP_CFG"
|
||||||
|
echo "" >> "$TMP_CFG"
|
||||||
|
|
||||||
if command -v niri >/dev/null 2>&1; then
|
if command -v niri >/dev/null 2>&1; then
|
||||||
cat "$SHELL_DIR/matugen/configs/niri.toml" >> "$TMP_CFG"
|
cat "$SHELL_DIR/matugen/configs/niri.toml" >> "$TMP_CFG"
|
||||||
echo "" >> "$TMP_CFG"
|
echo "" >> "$TMP_CFG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v qt5ct >/dev/null 2>&1; then
|
if command -v qt5ct >/dev/null 2>&1; then
|
||||||
cat "$SHELL_DIR/matugen/configs/qt5ct.toml" >> "$TMP_CFG"
|
cat "$SHELL_DIR/matugen/configs/qt5ct.toml" >> "$TMP_CFG"
|
||||||
echo "" >> "$TMP_CFG"
|
echo "" >> "$TMP_CFG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v qt6ct >/dev/null 2>&1; then
|
if command -v qt6ct >/dev/null 2>&1; then
|
||||||
cat "$SHELL_DIR/matugen/configs/qt6ct.toml" >> "$TMP_CFG"
|
cat "$SHELL_DIR/matugen/configs/qt6ct.toml" >> "$TMP_CFG"
|
||||||
echo "" >> "$TMP_CFG"
|
echo "" >> "$TMP_CFG"
|
||||||
@@ -201,9 +206,6 @@ build_once() {
|
|||||||
|
|
||||||
echo "$JSON" | grep -q '"primary"' || { echo "matugen JSON missing primary" >&2; return 2; }
|
echo "$JSON" | grep -q '"primary"' || { echo "matugen JSON missing primary" >&2; return 2; }
|
||||||
printf "%s" "$JSON" > "$LAST_JSON"
|
printf "%s" "$JSON" > "$LAST_JSON"
|
||||||
|
|
||||||
# Write JSON for Theme.qml FileView to watch
|
|
||||||
printf "%s" "$JSON" > "$STATE_DIR/dms-colors.json"
|
|
||||||
|
|
||||||
if [ "$mode" = "light" ]; then
|
if [ "$mode" = "light" ]; then
|
||||||
SECTION=$(echo "$JSON" | sed -n 's/.*"light":{\([^}]*\)}.*/\1/p')
|
SECTION=$(echo "$JSON" | sed -n 's/.*"light":{\([^}]*\)}.*/\1/p')
|
||||||
|
|||||||
Reference in New Issue
Block a user