Closed MajliTech closed 2 years ago
You shouldn't use user.picture
anymore; this property was deprecated in lightdm-webkit2-greeter and now it's removed from web-greeter and nody-greeter.
Instead, use user.image
.
Also, you should check if the image
does actually exists. Some users may not have an image, so your code will always return undefined
in those cases.
You could have something like this:
function getPicOf(user) {
for (let i in lightdm.users) {
if (lightdm.users[i].username == user && lightdm.users[i].image){
return lightdm.users[i].image
}
}
return "placeholder.png"
}
Thanks for quick response, it's working now.
So, the title says it all. Maybe I will give you my code for refrence.
So, I runned
alert(getPicOf("majlitech"))
and it gave me undefined. Can someone tell me what I'm doing wrong? Thanks. Yes, I have a picture on my account.