Skip to content

Instantly share code, notes, and snippets.

@kdauzickas
Created March 11, 2013 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdauzickas/5134656 to your computer and use it in GitHub Desktop.
Save kdauzickas/5134656 to your computer and use it in GitHub Desktop.
Use gravatar image as user image. Works with Fedora 18, not tested with any other distro/version
#! /bin/bash
me=$(logname)
echo "Type in the email you use with gravatar: "
read email
md5=$(echo -n $email | md5sum | cut -f1 -d' ')
echo "Fetching image to /var/lib/AccountsService/icons/$me..."
wget --quiet http://www.gravatar.com/avatar/$md5?s=128 --output-document="/var/lib/AccountsService/icons/$me"
echo "Setting image..."
echo Icon=/var/lib/AccountsService/icons/$me >> /var/lib/AccountsService/users/$me
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment