Aggiungere icone a Xandros

To add an icon to simple mode, there's a few steps you need to follow:

1:  _create_ the icon, in each of it's separate "display" modes. 
    This would be a series of six 120x120 pixel .png images with alpha chanel transparency.
    (one with just the icon, and five "highlited" versions) 
    "Blank" templates have been provided for each of the highlighted versions, in the /opt/xandros/share/AsusLauncher/ directory, named as follows:

icon_background.png
addiconimages/icon_background.png
accessibility_icon_background.png
addiconimages/accessibility_icon_background.png
business_icon_background.png
addiconimages/business_icon_background.png
home_icon_background.png
addiconimages/home_icon_background.png
student_icon_background.png
addiconimages/student_icon_background.png


You need to first pick the graphic for your icon, and then create it as a blank one.  My icon was for activating the Remote Desktop program that's already installed on the Eee, so I used the graphic normally associated with it in Windows, and made my base icon from it.  The base icon should be named something related to your program, and ending in _norm.png, so here's my rdesk_norm.png:
addiconimages/rdesk_norm.png
I've made one error in this icon, which I'll explain later - it's not obvious yet, but once it's finished it's easy to spot.  (Learn from my mistakes!) Also, the edges of the icon are anti-aliased using the .png format's alpha chanel, so that they'll blend into whatever colour the background may be.

Next, you need to apply your icon to a copy of each of the coloured highlight backgrounds, and save them.  The first one, based on "icon_background.png" should be named 'program'_hi.png (where 'program' is your name).  My rdesk_hi.png looks like this:
addiconimages/rdesk_hi.png
Notice that the icon itself is in exactly the same location - I've simply merged the two images together, so that the background shows through the translucent areas.  After you've created the first "merged" images, the rest of them follow a very specific naming convention - the one you merge with accessibility_icon_background.png should be named accessibility_'program'_hi.png (again, where 'program' is your chosen name), and so on - each of the 'group'_icon_background images needs a corresponding 'group'_'program'_hi.png output.  Here are mine:


accessibility_rdesk_hi.png
addiconimages/accessibility_rdesk_hi.png
business_rdesk_hi.png
addiconimages/business_rdesk_hi.png
home_rdesk_hi.png
addiconimages/home_rdesk_hi.png
student_rdesk_hi.png
addiconimages/student_rdesk_hi.png


2: Now that we actually have an icon, we need to put those files into the /opt/xandros/share/AsusLauncher/ directory along with the others.  (IMPORTANT: keep a backup of them, in case you need to restore them for any reason.)

3: Next, we need to add the icon configuration to the file /opt/xandros/share/AsusLauncher/simpleui.rc - first though, make a backup!!!!! - otherwise if you mess anything up, you may need to restore your EeePC from scratch, and all of your work is gone.  This file is an XML file, and the format for it is very simple - the <simpleui> tag wraps around the whole file, then there's a series of <simplecat> and <parcel> tags, which each  create either a tab group, or an icon respectively.  The easiest to deal with are the icons, and that's what we're looking for here anyways.  To add an icon for my rdesk program, here's what I needed to do.  First, I need the actual linux shell command that's going to be run - in my case, that was /usr/bin/rdesktop -g800x480 -f 192.168.0.123 to run rdesktop and log into my local windows server, with the screen size forced to the EeePC's 800x480 resolution.  You need to include the full UNIX path to the initial command, otherwise it may not find the program you're looking for.  We also need to  decide which tab we're putting the icon under.  Our initial choices are: Internet, Work, Learn, Play, Settings, and Favorites.  In my case, rdesktop is a network program, so I'm going to go with the Internet tab.
  Here's what the resulting <parcel> looks like, with my command, tab, and the image names highlighted appropriately:

<parcel simplecat="Internet" extraargs="/usr/bin/rdesktop -g800x480 -f 192.168.0.123"
    icon="rdesk_norm.png"
    selected_icon="rdesk_hi.png">
      <name lang="en">Remote Desktop</name>
      <name lang="zh_TW">Remote Desktop</name>
      <name lang="zh_CN">Remote Desktop</name>
      <desc lang="en">Windows Terminal Server Login</desc>
</parcel>

The <name> tags inside create the icon name which shows up on the desktop, and you should include one for each language you may end up booting in. (I included the two chinese ones here as examples, mainly because they're the ones used most often in the original simpleui.rc itself.)  The <desc> tag should be a very short description of what the icon is for. More descriptive than the icon title, but shorter than a full wikipedia entry.

The last part of this step involves inserting your new <parcel> into the simpleui.rc file - put it at the end, just before the closing </simpleui> tag.  (It must be on the inside of that tag! Otherwise it breaks the file and your interface will either ignore it, or won't work at all.)

4:  The final step, hit <ctrl><alt><backspace> to reset your X-windows server.  It's not a full reboot, but reloading the X server makes it re-read the configuration files.  Assuming all is done correctly, your new icon should appear, like this:
addiconimages/snapshot1.png

And now of course, my own error becomes obvious - always remember to leave some blank space at the bottom of your new icon for the icon's name to show up in on the desktop...

Oh, one thing I almost forgot to mention - the method above only works until the first time you upgrade your software or install a new package - then you'll need to re-insert the <parcel> tag in the simpleui.rc file. (The icon images survive that fine)  I'm still looking (in what little spare time I have, so slowly) for the place to put the new data so that it will survive something else being installed.

Also, if you don't want to create your own icon, there are a lot of them already created in the /opt/xandros/share/AsusLauncher/ directory, feel free to use them as well if one of them suits you.  You just need to include the name of the *_norm.png and *_hi.png versions in the right places.  The Asus Launcher will fill in the student_, home_, and so on automatically.