JezerM / web-greeter

A modern, visually appealing greeter for LightDM.
https://web-greeter-page.vercel.app
GNU General Public License v3.0
216 stars 12 forks source link

Unable to access to the Avatar Image #83

Open lesebas opened 1 month ago

lesebas commented 1 month ago

Hello, I'm trying to migrate the petrichor theme from webkit2 to web-greeter. (https://github.com/phillid/petrichor/tree/master). The code to update the icon of each user into petrichor.js (same as main.js) is as below :

var html = ""; for (i in lightdm.users) { user = lightdm.users[i];

    if (user.image == null || user.image.match(/\.face$/))
        image = '/usr/share/icons/Adwaita/256x256/emotes/face-laugh.png';
    else
        image = user.image;

    html += '<a href="#" class="user" id="user-' + user.name +'" onclick="start_authentication(\'' + user.name + '\')">';
    html += '<img class="avatar" src="file:///' + image + '" /><span class="name">'+user.display_name+'</span>';

    if (user.name == lightdm.autologin_user && lightdm.autologin_timeout > 0)
        html += '<span id="countdown-label"></span>';

    html += '</a>';
}

document.getElementById('users').innerHTML = html;

The default Image is not working but it's normal as I should use the default image defined into web-greeter.yml

However the html section added into the web page do not work even if an icon is defined for the user. I receive an error message as the html page cannot access to /var/lib/AccountsService/icons/username.png.

Any idea to help me?

TheWisker commented 2 days ago

I also had some problems accessing the avatar images. If it helps here is what I did to solve them: