Using Leopard's icons for your own purposes

I tend to change the icon of my hard drive to reflect whichever Mac I'm on -- my MacBook has a little MacBook for its icon, and my iMac has an iMac for its icon. Usually I go to a third party who creates these clever looking icons and then add them to my machine, but with Leopard's gorgeous 512x512 icons I wanted to just use them and be done with it.

Unfortunately it's a little tricky. First, make sure your account has administrative access. Then find your icons. These are where the actual .icns files are located. (You can Cover Flow this folder for some nice eye candy.) You're not quite done yet; usually you can just copy the little icon in "get info" over and be done with it, but that only copies the icon for the ICNS file format.

Drag the .icns file over and then run this command in Terminal:

sips -s format png ~/Desktop/icon-filename.icns --out ~/Desktop/converted.png

(Note: "--out" should be two hyphens.)

Then right click on the newly created PNG file on your desktop, click "Get Info", and highlight the little icon above the Spotlight Comments section. It should turn blue. Do a command+C, then right click on your hard drive's icon, click "Get Info", highlight the small hard drive icon again, and command+V to paste over the new icon. It should change the desktop hard drive icon (if you display hard drives on your desktop, that is).

I feel this process got slightly more complicated with Leopard due to the addition of QuickLook, as there's almost two icons per file now: the regular extension-based icon, and the dynamically generated preview icons.