Last night one of my twitter friends (Ben Casablancas) asked me an interesting question, he wanted to grab his OS X login screen ‘avatar’ for use on twitter. Now, on first appearances the image file seemed to be well hidden away in the deep dark depths of the OS X file system.
However using this little snippet of code in a terminal window made it much easier to find:
1 |
dscl . -read /Users/`id -un` JPEGPhoto | tail -1 | xxd -r -p > ~/Desktop/MyAccountPic.jpg |
Now if you check your desktop, you should see a JPG labelled MyAccountPic.jpg. That’s right… That’s the picture seen in the login window. But wait… I hear you cry, what about the ‘halo’ ring! Well don’t you worry, we’ve got that covered too!
Back in terminal, paste in this line:
1 |
cp /System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/A/Frameworks/LoginUICore.framework/Versions/A/Resources/avatarWhiteRing.png ~/Desktop/MyRing.png |
You should now find another image on your desktop – this one labelled MyRing.png. This is the ‘halo’ circle from around your avatar. Now last but not least, you’ll be wanting the mask to go with that:
Back in terminal, paste in this line:
1 |
cp /System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/A/Frameworks/LoginUICore.framework/Versions/A/Resources/avatarMask.png ~/Desktop/MyMask.png |
You’ve guessed it! You will now also have an image on your desktop labelled MyMask.png.
So although it’s hidden away, using the extremely powerful terminal it can easily be retrieved.
For reference, all the code above does is create copies of the graphics, and is in no way dangerous. If your stuck looking for something in OS X drop me a line and maybe I can help you too.