mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 16:02:51 -05:00
meta: many resource usage improvements and consolidations
This commit is contained in:
@@ -23,10 +23,6 @@ Singleton {
|
||||
uptimeProcess.running = true;
|
||||
}
|
||||
|
||||
function getProfilePicture() {
|
||||
profilePictureProcess.running = true;
|
||||
}
|
||||
|
||||
function refreshUserInfo() {
|
||||
getUserInfo();
|
||||
getUptime();
|
||||
@@ -61,8 +57,6 @@ Singleton {
|
||||
root.fullName = parts[1] || parts[0] || "";
|
||||
root.hostname = parts[2] || "";
|
||||
console.log("UserInfoService: User info loaded -", root.username, root.fullName, root.hostname);
|
||||
// Try to find profile picture
|
||||
getProfilePicture();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,53 +82,5 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Look for profile picture in common locations
|
||||
Process {
|
||||
id: profilePictureProcess
|
||||
|
||||
command: ["bash", "-c", `
|
||||
# Try common profile picture locations
|
||||
for path in \
|
||||
"$HOME/.face" \
|
||||
"$HOME/.face.icon" \
|
||||
"/var/lib/AccountsService/icons/$USER" \
|
||||
"/usr/share/pixmaps/faces/$USER" \
|
||||
"/usr/share/pixmaps/faces/$USER.png" \
|
||||
"/usr/share/pixmaps/faces/$USER.jpg"; do
|
||||
if [ -f "$path" ]; then
|
||||
echo "$path"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
# Fallback to generic user icon
|
||||
echo ""
|
||||
`]
|
||||
running: false
|
||||
onExited: (exitCode) => {
|
||||
if (exitCode !== 0) {
|
||||
console.warn("UserInfoService: Failed to find profile picture");
|
||||
root.profilePicture = "";
|
||||
root.profileAvailable = false;
|
||||
}
|
||||
}
|
||||
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
const path = text.trim();
|
||||
if (path && path.length > 0) {
|
||||
root.profilePicture = "file://" + path;
|
||||
root.profileAvailable = true;
|
||||
console.log("UserInfoService: Profile picture found at", path);
|
||||
} else {
|
||||
root.profilePicture = "";
|
||||
root.profileAvailable = false;
|
||||
console.log("UserInfoService: No profile picture found, using default avatar");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user