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

ipc for light/dark mode

This commit is contained in:
bbedward
2025-07-28 15:31:27 -04:00
parent 199c1c3043
commit 99e890cc17
3 changed files with 40 additions and 11 deletions

View File

@@ -218,6 +218,9 @@ Singleton {
function setLightMode(lightMode) {
isLightMode = lightMode;
if (typeof Theme !== "undefined") {
Theme.isLightMode = lightMode;
}
saveSettings();
}
@@ -740,4 +743,27 @@ Singleton {
return "SUCCESS: Wallpaper cleared"
}
}
IpcHandler {
target: "theme"
function toggle(): string {
root.setLightMode(!root.isLightMode)
return root.isLightMode ? "light" : "dark"
}
function light(): string {
root.setLightMode(true)
return "light"
}
function dark(): string {
root.setLightMode(false)
return "dark"
}
function get(): string {
return root.isLightMode ? "light" : "dark"
}
}
}