1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-24 12:05:21 -04:00

fix: gate mango matugen and Cosmic config sync on active session

This commit is contained in:
purian23
2026-06-23 23:22:42 -04:00
parent 774796ada2
commit aea5189abb
6 changed files with 78 additions and 3 deletions
+9
View File
@@ -1372,7 +1372,14 @@ Singleton {
}
}
function cosmicIntegrationAvailable() {
const desktop = (Quickshell.env("XDG_CURRENT_DESKTOP") || "").toUpperCase();
return desktop.includes("COSMIC");
}
function updateCosmicIconTheme() {
if (!cosmicIntegrationAvailable())
return;
const resolved = resolveIconTheme();
let cosmicThemeName = (resolved === "System Default") ? systemDefaultIconTheme : resolved;
if (!cosmicThemeName || cosmicThemeName === "System Default") {
@@ -1403,6 +1410,8 @@ Singleton {
}
function updateCosmicThemeMode(isLightMode) {
if (!cosmicIntegrationAvailable())
return;
const isDark = isLightMode ? "false" : "true";
const script = `mkdir -p ${_configDir}/cosmic/com.system76.CosmicTheme.Mode/v1
printf '%s\\n' ${isDark} > ${_configDir}/cosmic/com.system76.CosmicTheme.Mode/v1/is_dark 2>/dev/null || true`;
+2
View File
@@ -414,6 +414,8 @@ Singleton {
}
function reloadConfig(showToast, suppressWatch) {
if (!CompositorService.isMango || !root.available)
return;
const shouldShowToast = showToast !== false;
const shouldSuppressWatch = suppressWatch !== false;
if (shouldSuppressWatch)
+1 -1
View File
@@ -1,4 +1,4 @@
[templates.dmsmango]
input_path = 'SHELL_DIR/matugen/templates/mango-colors.conf'
output_path = 'CONFIG_DIR/mango/dms/colors.conf'
post_hook = 'sh -c "mmsg dispatch reload_config 2>&1 || true"'
post_hook = 'sh -c "[ -n \"$MANGO_INSTANCE_SIGNATURE\" ] && mmsg dispatch reload_config || true"'