AllTray is a very useful Linux utility that many are not aware of. The problem it solves is this : Many a time, the Linux application (Eg Thunderbird, Subscription, Gedit) that you use may not have a tray icon. This means when you click on the application’s close button , the application is terminated. This is in contrast to some other applications like Pidgin, Empathy , Rhythmbox and others which gets minimized to system tray and stay in the background when you click on the close button.
AllTray is a Linux utility that can make any Linux application to get minimized in the system tray (and not get terminated) when you press the close icon. An alternate way to say the same thing is that , AllTray allows you to “dock” any application, although it looks more like a Mac lingo.
If you are in Ubuntu, then the easiest way to install it is
sudo apt-get install alltray
If you are in any other Linux variant, then you can go to AllTray’s homepage and get the source code and install it yourself.
Using AllTray in GUI Mode
The most common way to use AllTray is using its GUI. So start any application that you want to be minimized. Then start AllTray from Applications -> Accessories -> AllTray. You will get a small dialog box which says “Please click on the window you would like to dock ” and a “Cancel” button . The mouse pointer also changes to a “+” sign. Now click on the title bar of the application that you want to minimize (or dock). The application now moves to system tray and it is immediately minimized.
Now you can click on the icon at the system tray to maximize/minimize the application. If you want to permanently close it , then right click on the application and select “Exit” . If you want to remove AllTray’s behavior (ie make the application behave conventionally) then right click on the tray icon and select “Undock”. The application will now be maximized, the icon is removed from system tray and if you now click on the close button , then the application is truly terminated.
Using AllTray in Console Mode
I really like the fact that AllTray also works well from the console and it has more options when you invoke from the console. You can try “alltray –help” to get all the options.
Scenario 1 : Dock/Minimize a new application
This is the typical scenario in which you start a new application from the console, and want it to be minimized to the system tray. Using thunderbird as an example,
This makes allTray run in console’s foreground. If you want to make it run in the background , append an “&” to the command. The side effect is that if you close the console , the application gets terminated.
Scenario 2 : Dock a new application but do not minimize it immediately
Usually, for an application like Thunderbird, you do not want to minimize it immediately. You want to check your emails first and then when you close it, you want it to be minimized. To do that ,
alltray thunderbird -s
Scenario 3 : Dock an existing application
Sometimes, you might want to move an existing application to be docked. AllTray currently does not have any functionality from console to do that. (previously it had a -p pid option). So in this case, it is easier to do it using the GUI. (Refer the steps for GUI above).
Scenario 4 : Maximizing a docked application using keyboard shortcuts
Currently, once you dock an application, the only way to view it again is to click on the system tray icon. AllTray has an option that allows you to maximize a docked application using a keyboard shortcut. Using Thunderbird as an example again,
/usr/bin/alltray /usr/bin/thunderbird -k Alt:t
In this case, Thunderbird starts out minimized and I can press Alt+t to maximize it whenever I want. Pressing it again, minimizes it. I was not able to assign it a shortcut using the super key (ie Windows key) like super + t . This was because Super was not an acceptable modifier – I was able to assign shortcuts like Alt+Super(windows) though. For more details check alltray –help.
Scenario 5 : Using it for startup applications
I use Thunderbird and Sunbird extensively and have it in my startup applications. I used to manually minimize them using AllTray GUI. Now a days, I use the command line version to minimize it automatically. For eg, enter either of the following command at System -> Preferences -> Startup Applications
/usr/bin/alltray /usr/bin/sunbird -k Alt:s
/usr/bin/alltray /usr/bin/thunderbird -k Alt:t –s
So , when the system starts, it starts both Sunbird and Thunderbird. Sunbird is immediately minimized and I can use Alt+s to maximize/minimize it. Thunderbird starts out in a maximized form (and does not dock immediately). I can check the emails and then click on the close button and it will get minimized to system tray. I can use Alt+t to control minimizing/maximizing Thunderbird.
AllTray is a neat utility and I hope it is useful for you !
If you liked this post , please subscribe to the RSS feed.