Trayer

Program Tray


Some applets deposit icons in the system tray of the KDE or Gnome task bar. If you don't use KDE or Gnome but you still want the system tray applets, check out Trayer.

By Hagen Höpfner

Window managers such as Fluxbox [1] provide their own interface for KDE and Gnome applets. These miniature programs slot into the system tray of the task bar, adding all kinds of practical functions. For example, the KDE alarm daemon keeps track of your appointments. The KMail applet monitors your mailbox. And some programs that are not even part of the major desktop distributions add their own quick-access applets.

If you would like to keep these goodies even though you are using an alternative window manager, Trayer could be a big help. This handy tool lets you add a task bar anywhere on the desktop, giving you a convenient space to drop your tray applets. The program is based on Anatoly Asviyan's fbpanel [2]. Maciej Delmanowski extracted the tray components from this program launcher and came up with a stand-alone application.

Installation

If you are interested in trying out Trayer and you do not use Debian, you will need to compile the source code. The source code for Trayer and a prebuilt Debian package are available from [3]. Assuming you have installed the gtk2, gdk-pixbuff, and matching developer packages, you can build and install the application by entering make && su -c "make install". Note that make install will not copy the binary to /usr/bin. If you prefer to install below /usr/local/bin, leave out the install command and manually copy the trayer file to the folder where you keep your home-made binaries.

Users with Suse Linux 9.3 are likely to experience some difficulty building the binaries, as the header files from the developer packages with this distribution no longer contain the required definitions [4]. To remedy this, update your GTK2 library. Suse Linux stores the library in a GNOME add-on package for version 2.7.5. After updating your system (see the box titled Suse 9.3 Add-ons), you should be able to build Trayer. After doing so, it is a good idea to replace the GTK2 libraries with the original versions again. The new version caused us no end of trouble with GTK-based applications such as Thunderbird, Firefox, and Gimp on our lab machine.

Now launch your new program by giving the trayer command to automatically drop system tray applets for KDE and Gnome, such as the Skype applet shown in Figure 1, in the new tray.

Figure 1: Gnome and KDE applets reside in the tray.
Suse 9.3 Add-Ons

Some Suse program packages add updated versions of a few applications to the distribution. To install them, you need to add a new installation source to YaST. The updated GTK2 packages are available from the server at ftp-stud.fht-esslingen.de. Specify the /pub/Mirrors/ftp.suse.com/pub/suse/i386/supplementary/GNOME/update_for_9.3/yast-source/ directory. After adding this installation source, the new packets will become available in the YaST software module. Select the gtk2-devel package for installation. YaST will then automatically resolve any dependencies. To revert to the previous GTK2 version without any trouble, just disable the sources you added. YaST will then access the original packages.

Positioning, Scaling, Modifying

One of Trayer's main benefits is that you can put the tray wherever you like. This is a useful feature, as it prevents the program from hiding any elements of your preferred window manager. If your window manager has a task bar at the bottom of the screen, you can put Trayer at the top or side. If you use WindowMaker, which puts the dock and the clip in the corners of the screen, the space in between is a good place for Trayer. Command line options tell Trayer in what part of the desktop you want it to set up camp and what kind of look you prefer.

For example, Figure 2 shows the effect of entering the trayer --transparent true --edge top --distance 5 --widthtype pixel --width 100 command on WindowMaker. The --distance 5 and --edge top parameters send Trayer to a spot five pixels from the top edge of the screen. --transparent true means that Trayer will allow the desktop wallpaper to shimmer through, and the last two parameters, --widthtype pixel --width 100, create a program tray with a width of 100 pixels. The values left, right, and bottom for the --edge parameter send Trayer to the left, right, or bottom edge of the screen, respectively.

Figure 2: Command line options help users specify the screen position and transparency mode for Trayer.

If you want Trayer in the bottom left corner of the screen, try the following options:--edge bottom --align left (Figure 3). If you prefer to move the bar to the right, try --align=right instead. If you do not specify the alignment, Trayer will be centered, which actually makes the --align=center option redundant.

Figure 3: Trayer also works with Blackbox, as you can see by looking at the bottom left corner of the screen in this figure.

Instead of specifying a width value for Trayer in pixels, you can specify a percentage of the screen width. The program gives you the --widthtype percent option to do this. Using this option in combination with --width 50 tells Trayer to take up half the screen width. The --widthtype request option gives you a far more elegant approach to defining the width. This option tells Trayer to use exactly the amount of space it needs to display the applets running at the present time. In contrast to this, height options are restricted to a value for the --height parameter in pixels. To set the inside gap between the edge of the Trayer box and the first tray icon, use the --padding option in combination with a value in pixels.

You can use a similar approach to modify Trayer's look and feel. The transparency option, along with the --alpha and --tint options, all play important roles. The former option defines the degree of transparency; you can specify values between 0 and 255. --tint followed by a color name, such as --tint blue, paints the desktop background in the color you select.

The trayer -h command gives you a complete list of parameters. If you prefer, you could check out the README file, which is supplied with the source code. The file gives you even more detailed descriptions of the individual options.

Conclusions

Trayer gives KDE and Gnome applets a home on more or less any choice of window manager. Unfortunately, not all window managers are Trayer-friendly. Trayer was fine with WindowMaker and IceWM, but although we were able to dock the Skype tray icon on QVWM and Blackbox, some KDE applications, such as the Licq KDE plugin tray icon refused to cooperate. Window managers that draw frames around every single window - TWM to name just one - are theoretically suitable for use with Trayer, but a frame around the tray is not everyone's idea of an appealing look.

INFO
[1] Andrea Müller: "Opening Pandora's Box," Linux Magazine 06/2004, pg. 81.
[2] fbpanel: http://fbpanel.sourceforge.net/
[3] Trayer: http://developer.berlios.de/project/showfiles.php?group_id=1595
[4] Suse Linux and modified GTK: http://lists.gnu.org/archive/html/emacs-pretest-bug/2005-07/msg00066.html