How to add icons to your E16 Desktop? by Prodigy

This is a quick reference guide that will enable you to add icons to your E16 desktop. For illustrative purposes I shall demonstrate how to add an Eterm icon. Once you know the trick for one icon, you can extend it to several icons.

First of all you should cd into your $HOME/.enlightenment/themes/whatever_theme/ and locate the imageclasses.cfg file. Then add to it:

__ICLASS __BGN
    __NAME ICONBAR_MYETERM
    __NORMAL "buttons/images/Eterm.png"
    __HILITED "buttons/images/Eterm2.png"
    __CLICKED "buttons/images/Eterm3.png"
__END

and place your desktop icons png images (Eterm.png, Eterm2.png, etc...) in the
$HOME/.enlightenment/themes/whatever_theme/buttons/images/ directory.

The first line of code tells E to that we have a new Imageclass:
__ICLASS __BGN
and we also have to give it a name, i.e MYETERM:
__NAME ICONBAR_MYETERM
The rest of the code is pretty explicit: It tells E which icons to use when in Inactive (NORMAL), Active (HILITED) and Clicked state:
__NORMAL "buttons/images/Eterm.png"
__HILITED "buttons/images/Eterm2.png"
__CLICKED "buttons/images/Eterm3.png"
After some lines of codes, we tell E that this is the end of that piece of code:
__END

Then locate the buttons.cfg file in your $HOME/.enlightenment/themes/whatever_theme/ directory, and add the following code:

__BUTTON __BGN
    __NAME ICONBAR_MYETERM
    __ICLASS ICONBAR_MYETERM
    __ACLASS ICONBAR_MYETERM
      __KEEP_ON_TOP __OFF
      __USE_SIZE_OF_IMAGE __ON
      __MAKE_STICKY __OFF
      __SHOW_BY_DEFAULT __ON
    __X_ORIGIN 0
    __Y_ORIGIN 0
    __X_PERCENTAGE 224
    __X_ABSOLUTE 0
    __Y_PERCENTAGE 1024
    __Y_ABSOLUTE -64
__END

In the buttons.cfg, we use the same name as before. Remember to use different names for different icons.
__NAME ICONBAR_MYETERM
We tell E the name of the Image and Action classes to which we associate our icon/button:
__ICLASS ICONBAR_MYETERM
__ACLASS ICONBAR_MYETERM
Then we give the button some properties: The names basically say what they do so we don't really need to explain!
__KEEP_ON_TOP __OFF
__USE_SIZE_OF_IMAGE __ON
__MAKE_STICKY __OFF
__SHOW_BY_DEFAULT __ON
Next we position the button to an appropriate location. This can be changed later on by dragging the button with the mouse inside Enlightenment. E will remember the new position of the button when you drag it, so you don't really have to worry about this part.
__X_ORIGIN 0
__Y_ORIGIN 0
__X_PERCENTAGE 224
__X_ABSOLUTE 0
__Y_PERCENTAGE 1024
__Y_ABSOLUTE -64
If you insert other icons, you only need to change the __X_ABSOLUTE values to 64, 128, 192, 256, etc... don't worry so much about the rest although you might want to experiment with some positioning.

Finally locate the actionclasses.cfg file in $HOME/.enlightenment/themes/whatever_theme/ directory and add this piece of code:

__ACLASS __BGN
    __NAME ICONBAR_MYETERM
    __TOOLTIP_TEXT "DESKTOP ICON"
    __TYPE __TYPE_NORMAL
    __TOOLTIP_ACTION_TEXT "My dear Eterm"
    __BUTTON 1
    __EVENT __MOUSE_RELEASE
    __ACTION __A_EXEC Eterm
__END

As usual we define a new Action class:
__ACLASS __BGN
with proper naming:
__NAME ICONBAR_MYETERM
Give some instructions to the Tooltip to display a "Desktop Icon" banner:
__TOOLTIP_TEXT "DESKTOP ICON"
We instruct E what to display in the event of an action:
__TOOLTIP_ACTION_TEXT "My dear Eterm"
We then tell E that we're dealing with a button. Event if you add multiple icons, don't change this part.
__BUTTON 1
Finally we tell E what to execute when we click the button. In this case to execute "Eterm":
__EVENT __MOUSE_RELEASE
__ACTION __A_EXEC Eterm

For several icons, we repeat the same steps but we change the NAMES everywhere, and we also change the __X_ABSOLUTE values in the buttons.cfg file.

You might also want to make it neater by writing in imageclasses.cfg the following:

#include <buttons/images.cfg>

and by writing your imageclasses code in $THEMES/buttons/images.cfg and similarly for the actionclasses.cfg, you could insert;

#include <buttons/actions.cfg>

and write your actionclasses code in $THEMES/buttons/actions.cfg

Good luck placing your icons on your desktops. :-)

Update: It seems that if you put the action, image and button classes into a file called button.cfg and place it in ~/enlightenment then it will be picked up by E no matter what theme you are currently running. This will save time and effort moving files around whenever you change a theme.

Also I've had a lot of mail concerning the always on top problem of the icons. I've spoken to Kwo, and he's had a go a fixing the issue placing the patch into the CVS version with respect to the date of this document - monkiboi.

This tutorial is available in a pdf format

| Home | To the top of this tutorial |

Page last updated: 27/11/04