This howto uses Thunderbird as an example, but should work with other programs which don't have built-in system tray capability. With appropriate modifications the method should work with other desktop systems.

4. At this stage the system tray icon will probably be hidden, so click on the "Show hidden icons" button and select Docker from the displayed list. Thunderbird will be displayed and can be used normally. Click on its Minimize button, and it becomes a hidden icon again. Open it again and click its Close button. The program closes down.

5. Using a text editor, create a desktop entry in ~/.config/autostart as follows:

7. (Double) click on thunderbird.desktop to start the program as a hidden icon again. Right-click on the "Show hidden icons" button and select "System tray settings". Select the Entries section, locate KDocker in the list, and change its visibility to "Shown". Click "Apply".

That's it. When you reboot, or log out and in again, the thunderbird icon should appear in the system tray. When you minimize thunderbird it will return to the system tray.