Networking – Add custom network device icons in Mac OS X Finder

findericonsnetworkingosx lionsamba

Mac OS X Finder is smug enough to display any non-Mac device as a picture of a PC with a BSOD, but I'm wondering if it's possible to add other devices, so my Ubuntu machine is detected and has a picture of a Ubuntu PC, and my Windows PCs has a picture of Windows crashing, etc.

I know that public.generic-pc.icns exists and can be replaced but I'm not interested in replacing it per se, more interested in getting finder to recognise other devices (or learn how it recognises other Apple devices) and map custom icons to them.

Any clue?

Best Answer

Seems that I was very close, I just wasn't getting my machine to advertise itself properly.

I finally got it to work:

Custom Network Device Image in Mac OS X

The method I used is below:

  1. First, on the Mac, I created a custom bundle which I called "ComputerTypes" by copying and pasting an existing bundle such as MobileDevices.bundle or MachineTypes.bundle in the /System/Library/CoreServices/CoreTypes.bundle/Contents/Library folder.

  2. I then opened Contents/Info.plist with XCode Plist Editor and edited all the details to create a custom bundle, changing the Bundle Identifier, Name, etc.

  3. I removed all the existing entries in the "UTExportedTypeDeclarations" key then created a new entry per device. Each device entry has a "UTTypeConformsTo", "UTTypeDescription", "UTTypeIconFile", "UTTypeIdentifier" and "UTTagSpecification", where the "UTTagSpecification" dictorinary contains an Array in the key "com.apple.device-model-code" with all of the mDNS _device-info._tcp identifiers to accept. UTTypeIconFile refers to a icns file in the Resources folder.

  4. I then saved the bundle to /System/Library/CoreServices/CoreTypes.bundle/Contents/Library folder and rebooted.

  5. On the other machine, I needed to set up to advertise a _smb._tcp service as well as the _device-info._tcp TXT record, as usual except using a custom model name rather than a Mac product name.

  6. After rebooting the Mac, it should appear like the picture above.

I uploaded the finished bundle to http://dl.dropbox.com/u/4140005/ComputerTypes.bundle.zip as an example.