Auto assign profile images on Ubuntu

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
When a new user is created in Ubuntu the default profile image is a silhouette. In my opinion an actual image would be better and the reason I say this is because when I see a linux machine with multiple userids the login screen looks awful with all those silhouettes. It turns out the profile image is just a file called “.face” in your home folder. So a simple script that looks for a “.face” file, and, if not found, picks up a random file from the list of choices, and copies it would do the job.
for ii in `ls /home`; do
if [ ! -f /home/$ii/.face ]; then
echo “assigning profile image to $ii ….”;
facefile=$(ls /usr/share/pixmaps/faces/ | sort –random-sort | head -1);
sudo cp /usr/share/pixmaps/faces/$facefile /home/$ii/.face;
sudo chown $ii /home/$ii/.face;
fi
done
Better still you can include a minor variant of this script in /usr/sbin/adduser and you should get a random image for every time a new user is created.

You might also like

Find Hardware Profile of Your Computer in Ubuntu 9.10 You want to...
Adblock for Opera (Blocking ads in Opera on Windows/Linux) Opera is a...
How to Change Default Grub Theme or Splash Image in Ubuntu 11.04 and 10.10 Ubuntu 11.04,...
Give Ubuntu Unity a Try (Install it in Ubuntu 10.10 Maverick) Unity is the...

About the Author

has written 2 posts on this blog.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

*

Copyright © 2017 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes