1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

disable matugen env var support, also dont reload ghostty if not

configured with dms theme
This commit is contained in:
bbedward
2025-09-24 17:09:15 -04:00
parent 3f8d8ca379
commit 9be7d44765
3 changed files with 12 additions and 12 deletions

View File

@@ -14,6 +14,8 @@ import "StockThemes.js" as StockThemes
Singleton {
id: root
readonly property bool envDisableMatugen: Quickshell.env("DMS_DISABLE_MATUGEN") === "1" || Quickshell.env("DMS_DISABLE_MATUGEN") === "true"
property string currentTheme: "blue"
property string currentThemeCategory: "generic"
property bool isLightMode: false
@@ -263,9 +265,6 @@ Singleton {
function forceGenerateSystemThemes() {
screenTransition()
if (!matugenAvailable) {
if (typeof ToastService !== "undefined") {
ToastService.showWarning("matugen not available - cannot generate system themes")
}
return
}
generateSystemThemesFromCurrentTheme()
@@ -509,7 +508,7 @@ Singleton {
function setDesiredTheme(kind, value, isLight, iconTheme, matugenType) {
if (!matugenAvailable) {
console.warn("matugen not available - cannot set system theme")
console.warn("matugen not available or disabled - cannot set system theme")
return
}
@@ -584,7 +583,7 @@ Singleton {
function applyGtkColors() {
if (!matugenAvailable) {
if (typeof ToastService !== "undefined") {
ToastService.showError("matugen not available - cannot apply GTK colors")
ToastService.showError("matugen not available or disabled - cannot apply GTK colors")
}
return
}
@@ -597,7 +596,7 @@ Singleton {
function applyQtColors() {
if (!matugenAvailable) {
if (typeof ToastService !== "undefined") {
ToastService.showError("matugen not available - cannot apply Qt colors")
ToastService.showError("matugen not available or disabled - cannot apply Qt colors")
}
return
}
@@ -666,12 +665,9 @@ Singleton {
id: matugenCheck
command: ["which", "matugen"]
onExited: code => {
matugenAvailable = (code === 0)
matugenAvailable = (code === 0) && !envDisableMatugen
if (!matugenAvailable) {
if (typeof ToastService !== "undefined") {
ToastService.wallpaperErrorStatus = "matugen_missing"
ToastService.showWarning("matugen not found - dynamic theming disabled")
}
console.log("matugen not not available in path or disabled via DMS_DISABLE_MATUGEN")
return
}
if (extractionRequested) {

View File

@@ -413,6 +413,8 @@ dms ipc call mpris next
## Theming
dms will spawn a matugen process on theme changes to generate color palettes for installed and supported apps. If you do not want these files generated, you can set the env variable `DMS_DISABLE_MATUGEN=1` to disable it entirely.
### Custom Themes
DankMaterialShell supports custom color themes! You can create your own Material Design 3 color schemes or use pre-made themes like Cyberpunk Electric, Hotline Miami, and Miami Vice.

View File

@@ -181,9 +181,11 @@ build_once() {
printf "%s\n\n" "$OUT" > "$TMP"
cat "$CONFIG_DIR/ghostty/config-dankcolors" >> "$TMP"
mv "$TMP" "$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 >/dev/null 2>&1 || true
fi
fi
fi
if command -v kitty >/dev/null 2>&1 && [[ -f "$CONFIG_DIR/kitty/dank-theme.conf" ]]; then
OUT=$("$SHELL_DIR/matugen/dank16.py" "$PRIMARY" $([[ "$mode" == "light" ]] && echo --light) ${HONOR:+--honor-primary "$HONOR"} ${SURFACE:+--background "$SURFACE"} --kitty 2>/dev/null || true)