UberStudent Forums
http://uberstudent.com/phpBB/

Showing user pictures and customizing login screen
http://uberstudent.com/phpBB/viewtopic.php?f=8&t=962
Page 2 of 2

Author:  Stephen Ewen [ Wed Sep 16, 2015 5:09 am ]
Post subject:  Re: Showing user pictures and customizing login screen

Thanks for your kind comments. :)

Regarding the user picture, as you can see, it's working well for me.

Try reducing the image to 48x48 pixels.

Then, make sure your username berker owns the file, and then change permissions to 644 without sudo:

Code:
sudo chown berker home/berker/.face
chmod 644 $HOME/.face

Attachment:
face2.png
face2.png [ 896.92 KiB | Viewed 6651 times ]

One other possible discrepancy: You mentioned that the default user image is "nobody.png."

Which one of these two?
Attachment:
nobody.png
nobody.png [ 1.38 KiB | Viewed 6651 times ]

Attachment:
epicurus.png
epicurus.png [ 10.27 KiB | Viewed 6651 times ]

Author:  Berker Pekoz [ Sat Sep 19, 2015 2:42 am ]
Post subject:  Re: Showing user pictures and customizing login screen

Unfortunately tried both but still didn't work :( and it's "nobody.png" nobody, not even epicurus :(

Author:  Stephen Ewen [ Sat Sep 19, 2015 8:14 pm ]
Post subject:  Re: Showing user pictures and customizing login screen

Please open a terminal and one line at a time run:
Code:
sudo apt-get install apt-show-versions
apt-show-versions mdm

Does the result contain the following?:
Code:
1.8.3+epicurus uptodate

If not, run the Update Manager and reboot. If unsolved, continue.

In the terminal run:
Code:
sudo mdmsetup

Does it appear like the following?
Attachment:
mdmsetup.png
mdmsetup.png [ 73.69 KiB | Viewed 6609 times ]

If not, then the theme does not support the .face file. This won't work.

If it does appear as shown above, then before exiting mdmsetup go to Options > Default session and make sure Run Xclient Script is selected.

If it does use the default mdm theme, hit Alt+F2 and run:
Code:
gksu geany /usr/share/mdm/html-themes/uberstudent/index.html

Lines 137 through 140 should show:
Code:
            var picture = document.createElement('img');
                picture.setAttribute('class', "user-picture");
                picture.setAttribute('src', "file:///home/"+username+"/.face");
                picture.setAttribute('onerror', "this.src='file:///usr/share/pixmaps/faces/epicurus.png';");

Is that the case? If so then this should be working! Note line 139 where the theme is commanded to read the .face file from your home directory. If everything is as it should be for this to work, "nobody.png" would not even be read.

If not working, you can try to force the matter:

Code:
sudo cp /home/berker/.face /usr/share/pixmaps/faces/berker.png
sudo chmod 644 /usr/share/pixmaps/faces/berker.png

And then on line 139 of the above index.html file replace the line with one containing the path to the image you just copied over:
Code:
                picture.setAttribute('src', "file:///usr/share/pixmaps/faces/berker.png");

Then reboot. Beyond the above, I'm stumped. :ugeek:

Author:  Berker Pekoz [ Sun Sep 20, 2015 7:34 pm ]
Post subject:  Re: Showing user pictures and customizing login screen

Stephen Ewen wrote:
Please open a terminal and one line at a time run:
Code:
sudo apt-get install apt-show-versions
apt-show-versions mdm

Does the result contain the following?:
Code:
1.8.3+epicurus uptodate

If not, run the Update Manager and reboot. If unsolved, continue.

In the terminal run:
Code:
sudo mdmsetup

Does it appear like the following?
Attachment:
mdmsetup.png

If not, then the theme does not support the .face file. This won't work.

If it does appear as shown above, then before exiting mdmsetup go to Options > Default session and make sure Run Xclient Script is selected.

If it does use the default mdm theme, hit Alt+F2 and run:
Code:
gksu geany /usr/share/mdm/html-themes/uberstudent/index.html

Lines 137 through 140 should show:
Code:
            var picture = document.createElement('img');
                picture.setAttribute('class', "user-picture");
                picture.setAttribute('src', "file:///home/"+username+"/.face");
                picture.setAttribute('onerror', "this.src='file:///usr/share/pixmaps/faces/epicurus.png';");

Is that the case? If so then this should be working! Note line 139 where the theme is commanded to read the .face file from your home directory. If everything is as it should be for this to work, "nobody.png" would not even be read.

If not working, you can try to force the matter:

Code:
sudo cp /home/berker/.face /usr/share/pixmaps/faces/berker.png
sudo chmod 644 /usr/share/pixmaps/faces/berker.png

And then on line 139 of the above index.html file replace the line with one containing the path to the image you just copied over:
Code:
                picture.setAttribute('src', "file:///usr/share/pixmaps/faces/berker.png");

Then reboot. Beyond the above, I'm stumped. :ugeek:


Everything was the same as expected except the onerror pointed to pixmaps/nobody.png instead of epicurus. Then I copied the png file and forced to use it using the last line of code you have stated, one step before being stumped, it worked. Now I see my face on the login screen :)

I wonder why it took me so long where everyone else's just works out of the box :D But thank you very much for your help :)

Page 2 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/