mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
profile image ipc
This commit is contained in:
@@ -14,6 +14,10 @@ Singleton {
|
|||||||
property bool settingsPortalAvailable: false
|
property bool settingsPortalAvailable: false
|
||||||
property int systemColorScheme: 0 // 0=default, 1=prefer-dark, 2=prefer-light
|
property int systemColorScheme: 0 // 0=default, 1=prefer-dark, 2=prefer-light
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
// Stub just to force IPC registration
|
||||||
|
}
|
||||||
|
|
||||||
function getSystemProfileImage() {
|
function getSystemProfileImage() {
|
||||||
systemProfileCheckProcess.running = true
|
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"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
26
docs/IPC.md
26
docs/IPC.md
@@ -234,6 +234,32 @@ qs -c dms ipc call wallpaper get
|
|||||||
qs -c dms ipc call wallpaper set /path/to/image.jpg
|
qs -c dms ipc call wallpaper set /path/to/image.jpg
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Target: `profile`
|
||||||
|
|
||||||
|
User profile image management.
|
||||||
|
|
||||||
|
### Functions
|
||||||
|
|
||||||
|
**`getImage`**
|
||||||
|
- Get current profile image path
|
||||||
|
- Returns: Full path to profile image or empty string if not set
|
||||||
|
|
||||||
|
**`setImage <path>`**
|
||||||
|
- Set profile image to specified path
|
||||||
|
- Parameters: `path` - Absolute or relative path to image file
|
||||||
|
- Returns: Success message with path or error message
|
||||||
|
|
||||||
|
**`clearImage`**
|
||||||
|
- Clear the profile image
|
||||||
|
- Returns: Success confirmation message
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
```bash
|
||||||
|
qs -c dms ipc call profile getImage
|
||||||
|
qs -c dms ipc call profile setImage /path/to/avatar.png
|
||||||
|
qs -c dms ipc call profile clearImage
|
||||||
|
```
|
||||||
|
|
||||||
## Target: `theme`
|
## Target: `theme`
|
||||||
|
|
||||||
Theme mode control (light/dark mode switching).
|
Theme mode control (light/dark mode switching).
|
||||||
|
|||||||
Reference in New Issue
Block a user