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:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user