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:
@@ -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`;
|
||||
|
||||
@@ -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,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"'
|
||||
|
||||
Reference in New Issue
Block a user