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

profile image ipc

This commit is contained in:
bbedward
2025-08-24 21:59:06 -04:00
parent f3c42f7f93
commit 08cc026c1f
3 changed files with 64 additions and 0 deletions

View File

@@ -14,6 +14,10 @@ Singleton {
property bool settingsPortalAvailable: false
property int systemColorScheme: 0 // 0=default, 1=prefer-dark, 2=prefer-light
function init() {
// Stub just to force IPC registration
}
function getSystemProfileImage() {
systemProfileCheckProcess.running = true
}
@@ -176,4 +180,34 @@ Singleton {
}
}
}
IpcHandler {
target: "profile"
function getImage(): string {
return root.profileImage
}
function setImage(path: string): string {
if (!path) {
return "ERROR: No path provided"
}
var absolutePath = path.startsWith(
"/") ? path : StandardPaths.writableLocation(
StandardPaths.HomeLocation) + "/" + path
try {
root.setProfileImage(absolutePath)
return "SUCCESS: Profile image set to " + absolutePath
} catch (e) {
return "ERROR: Failed to set profile image: " + e.toString()
}
}
function clearImage(): string {
root.setProfileImage("")
return "SUCCESS: Profile image cleared"
}
}
}