1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-30 00:12:50 -05:00

copy default-settings.json to settings.json if it exists

This commit is contained in:
bbedward
2025-08-25 23:47:02 -04:00
parent d48f5b0b3f
commit 08b555d724

View File

@@ -1005,7 +1005,8 @@ Singleton {
parseSettings(settingsFile.text()) parseSettings(settingsFile.text())
} }
onLoadFailed: error => { onLoadFailed: error => {
applyStoredTheme() // Check if default-settings.json exists and copy it
defaultSettingsCheckProcess.running = true
} }
} }
@@ -1070,6 +1071,22 @@ Singleton {
} }
} }
Process {
id: defaultSettingsCheckProcess
command: ["sh", "-c", "CONFIG_DIR=\"" + _configDir + "/DankMaterialShell\"; if [ -f \"$CONFIG_DIR/default-settings.json\" ] && [ ! -f \"$CONFIG_DIR/settings.json\" ]; then cp \"$CONFIG_DIR/default-settings.json\" \"$CONFIG_DIR/settings.json\" && echo 'copied'; else echo 'not_found'; fi"]
running: false
onExited: exitCode => {
if (exitCode === 0) {
console.log("Copied default-settings.json to settings.json")
settingsFile.reload()
} else {
// No default settings file found, just apply stored theme
applyStoredTheme()
}
}
}
IpcHandler { IpcHandler {
function show() { function show() {
root.setTopBarVisible(true) root.setTopBarVisible(true)