Next: , Previous: Installing adesklets, Up: Top



4 Using adesklets

4.1 ... As a desklets container

By itself, adesklets does little: it only provides what is needed to do more! You either need to tell it what to do by passing it commands (see the next section) or you need other scripts (the desklets) that will drive it for you.

Right now, only a very few desklets have been released: you may find them on the SourceForge projet page as separate downloads: http://sf.net/projects/adesklets/. They will give you a feel of what adesklets is capable of.

4.1.1 Add a new desklet to your X display

To add a new desklet script, simply:

  1. Download its tarball and unpack it somewhere in your home directory
  2. Look at the included README file; special requirements or instructions will be given. Usually, all you have to do is to get adesklets installed, your X server running, then launch the executable script file from the base directory.

Please note that:

Most of the time, desklets scripts are made to run as long as you do not tell them to quit. The user has total control of starting, stopping, restarting (when possible), and positionning the desklet (using the context menu, always available by right-clicking on the desklet). The desklet has no control over those operations.

Those few user settings are stored in the $HOME/.adesklets file. Usually, you do not want to edit this file yourself. If you do, make sure no instances of adesklets are running at the same time.

Special notes on system fonts

You may safely skip this section if you do not intend to use non-supplied fonts with adesklets.

Provided your system supports fontconfig (http://www.fontconfig.org/) and adesklets was compiled without using --without-fontconfig (compiling with fontconfig support is the default; See Installing adesklets.), all the TrueType fonts present in your system are available for use with adesklets. At initialization time, adesklets with fontconfig support compiled in will go through all the fonts detected on your system to identify all the TrueType fonts. See your fontconfig documentation on how to set up your application fonts access properly (See Frequently asked questions, for some fontconfig debugging hints). It's also good to know that adesklets' package includes a copy of Bitstream's Vera font; all users can rely on adesklets having at least this font available at all time.

Special notes on internationalization

You may safely skip this section if you do not intend to use extended charaters within your desklets.

If your system includes iconv support (See Installing adesklets.), you should be able to use any character from any charsets your system knows about for displaying text, either inside a desklet or in its menus, provided you have appropriate TrueType fonts (i.e. TrueType fonts containing those character representations)1.

Nevertheless, when using extended (outside 7-bit ASCII) characters, you need to make sure your local GNU readline settings do not interfere. These three parameters should be set as indicated below in the appropriate initrc file2:

     set input-meta on
     set convert-meta off
     output-meta on

If you do not want to adapt your GNU readline settings, you can also pass the --enable-force-extended-characters-input switch to the configure script when configuring the package from source, which will cause those three variables to always be appropriately overriden internally by the interpreter.

Of course, you will also need desklets built to use those extended characters. At the time of writing, all non-contributed Python desklets support them; for those, the charset can be set by the user in the configuration file, when it exists3; users merely have to set the 'coding' line appropriately4.

For instance, for using ISO Latin-1 characters, one should use something similar to:

     # -*- coding: ISO-8859-1 -*-

as the first or second line in the Python desklet configuration file5.

Finally, please note that if your platform does not support iconv, you should always leave the coding parameter to ASCII, otherwise you will get fatal errors such as charset conversion not compiled in from the desklets.

4.1.2 Restore previously running desklets on new X session

Invoking adesklets without any arguments:

     adesklets

is enough to restart all desklets that were running the last time you killed the X server (in this mode, adesklets will exit quickly by itself: there is no need to run it in the background. adesklets does not use a daemon; each applet will fork a standalone adesklets interpreter as a child process). Invoking adesklets when desklets are already running will cause them to be killed before the creation of new instances6.

If you plan on using desklets on a regular basis, you should put the previous adesklets command somewhere in your X session initialization. I cannot tell you where with precision, as it varies greatly from system to system. Have a look at: http://www.google.ca/search?q=''x window''+startup for general help.

4.2 ... As a command-line graphic editor

You can also use adesklets as a command-oriented graphic editor. If you type, in a console:

     adesklets :

You will get something similar to:

     adesklets 0.1.0 (Fri Jan 28 19:09:13 EST 2005), on Linux 2.6.10
     [gcc 3.4.3 20041125 (Gentoo Linux 3.4.3-r1, ssp-3.4.3-0, pie-8.7.7)]
     Press TAB for hints.
     0 >>> _

The last line is a prompt. It tells you you are ready to enter command number 0. As of adesklets 0.4.8, you have around 150 commands at your fingertips. Thanks to GNU readline, a lot of autocompletion hooks are present, giving you an easy way to look around. Press TAB while typing a command name or a command's first argument, and useful information will be displayed. See an adesklets's primer, for more info.


Footnotes

[1] For instance, Bitstream's Vera font included with adesklets contains glyphs for practically all Latin-1 (ISO-8859-1) characters.

[2] Please refer to your GNU readline documentation

[3] When it does not exist, it means the desklet does not need internationalization anyway

[4] See http://python.fyxm.net/peps/pep-0263.html

if you need details.

[5] Obviously, such a configuration file needs to be saved using ISO Latin-1 encoding or any subset of it, such as ASCII.

[6] Both adesklets process and their immediate parents will be sent a SIGKILL signal.