The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


SystemTray::Applet - OS agnostic system tray applets


Version 0.02


This code wraps existing gui toolkits and lets you create a system tray applet that doesn't require knowledge of the users toolkit.

    use SystemTray::Applet;

    my $foo = SystemTray::Applet->new("text" => "hello world");



 $applet = SystemTray::Applet->new( "text" => "hello world" );

This method looks for the highest priority plugin under the SystemTray::Applet namespace and passes the plugin name and any arguments passed in to create. This allows developers to use SystemTray::Applet to construct one of its system specific subclasses without knowing which ones may be installed.

If no plugins are found or object construction fails undef is returned.


 $applet = System::Tray::Applet::CmdLine->create( "text" => "hello world" );

This method is the SystemTray applet constructor. It should not be called directly. It should be called via SystemTray::Applet->new or as a subclasses constructor e.g. SystemTray::Applet::Create->create();

The following arguments can be passed as name value pairs

icon - name of a file to use as applet icon
text - text to display in applet or as hover text if an icon is supplied
callback - function to update the icon and text over time
frequency - how often in seconds to call the callback function
immediate - if true the callback is called on object creation , usually you need to wait frequency seconds

Note : The callback does not need to call $self->display() or $self->schedule() as the module takes care of that.

If the object can not be constucted undef is returned.



Subclass specific init method for object initialization.

This should not be call directly as it is only used by system specific subclasses.

This should return true in subclasses.



This method sets the objects icon by calling the system specific create icon method in the subclass



Subclass specific create_icon method for creating an icon class used by the system specific gui code.

This should not be called directly as it is only provided by the system specific subclass.



Subclass specific display method for updating the GUI representation of the applet.

This should not be called directly as it is only provided by the system specific subclass.



Subclass specific schedule method for scheduling the callback.

This should not be called directly as it is only provided by the system specific subclass.



Subclass specific method for starting the gui up. This never returns.


Peter Sinnott, <psinnott at>


Please report any bugs or feature requests to bug-systemtray-applet at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc SystemTray::Applet

You can also look for information at:



Copyright 2008 Peter Sinnott, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.