Specify the Finder icon with Avahi

Finder shared area icons Yesterday, I blogged about my various issues setting up Apple Filesharing on the Debian virtual server I’ve got running in Parallels. As of OS X 10.5, Leopard, the Finder has a shared area which shows the machines it’s discovered via Bonjour so you can easily connect to them. Today I got bored of having the default icon for my server, bizarrely Apple have set the default icon as a Cinema Display (what?), I wanted something more visually informative. After some Googling around and a bit of configuration on the Debian side, the server is now using an XServe icon.

This all takes advantage of an enhancement Apple added in Leopard, which allows a savvy server to specify its type and model. Leopard then uses one of its icons for various Mac hardware to represent that server.

Finder shared area icons The MacRumours forums provided the solution to how to configure Avahi to specify the hardware type in it’s broadcast announcement. Before starting to mess around, I had the following text in my Avahi service definition at /etc/avahi/services/afpd.service (N.B. that path is for a Debian machine, other distros may put their service definitions elsewhere):

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
</service-group>

After my alterations, the file read (I’ve emboldened the new portion):

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=RackMac</txt-record>
</service>
</service-group>

The model information I’ve used, sets the icon to an XServe icon (see the screenshot above). You can determine the model text you need to broadcast for other icons by digging through the Plist at /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist.

6 Responses to “Specify the Finder icon with Avahi”


  • Hi,

    Exactly what i was looking for!! Now my NAS shows up as a Xserve device instead of an iMac :-)

    Greetz
    Eldrik

  • Hi Eldrik – Glad to be of service!

  • Excellent tip! Thanks a lot!

    For the lazy ones, these are other possible models:

    Xserve (same a RackMac)
    PowerBook
    PowerMac
    Macmini
    iMac
    MacBook
    MacBookPro
    MacBookAir
    MacPro
    AppleTV1,1
    AirPort

    There is a lot of submodels defined. But for those you’ll have to look in the plist.

  • Is there a possibility of editing this .plist file and adding diff models? I’m looking at the .plist file right now and testing it…

  • simonwheatley

    Hi Nils… let us know how you get on with editing the .plist file, please!

  • Just FYI for anyone who may be curious: to show a Quicksilver instead of a Graphite PowerMac, use PowerMac3,5

Leave a Reply