# SystemTrayIconComponent does not work on Ubuntu

**URL:** <https://forum.juce.com/t/systemtrayiconcomponent-does-not-work-on-ubuntu/38174>\
**Category:** Linux\
**Created:** [March 20, 2020, 6:01pm UTC](https://forum.juce.com/t/systemtrayiconcomponent-does-not-work-on-ubuntu/38174 "2020-03-20T18:01:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![timur](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/timur/32/541_2.png) [@timur](https://forum.juce.com/u/timur)\
**Post date:** [March 20, 2020, 6:01pm UTC](https://forum.juce.com/t/systemtrayiconcomponent-does-not-work-on-ubuntu/38174/1 "2020-03-20T18:01:41Z")

</div>

I’m on Ubuntu 18.04 LTS. juce::SystemTrayIconComponent does not work as expected. This is what it looks like on my machine (the system tray icon is the yellow smiley face):

![Screenshot 2020-03-20 at 17.55.29](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/f/fd9d83397894640882ab52971a9e661677556e1c.png)

As you can see, it’s floating strangely in mid-air, somewhere near the upper left corner of the screen.

What I would have expected is that it would show up in the top menu bar in the upper right corner, just like the JetBrains Toolbox system tray icon (the purple thingy) does in the following screenshot:

![Screenshot 2020-03-20 at 17.55.35](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/1/19cf00e69c007e34f3eeb1accc4a399bc0170e3d.png)

How can I achieve this behaviour with JUCE?

For reference, the exact same JUCE app works perfectly fine on Windows and Mac – look for the smiley:

 ![Screenshot 2020-03-20 at 17.56.26](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/4/4ff467e065680b427269a63963cb4070421ee811.png)

 ![Screenshot 2020-03-20 at 17.57.08](https://us1.discourse-cdn.com/flex026/uploads/juce/original/2X/9/9a41987e937b247928f8d43d44bd2ae7850f97a4.png)

---

<div class="post-metadata">

**Author:** ![FeRDNYC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ferdnyc/32/7426_2.png) [@FeRDNYC](https://forum.juce.com/u/FeRDNYC)\
**Post date:** [March 21, 2020, 9:28am UTC](https://forum.juce.com/t/systemtrayiconcomponent-does-not-work-on-ubuntu/38174/2 "2020-03-21T09:28:32Z")

</div>

Looking at [the git blame for the `juce_linux_X11_SystemTrayComponent.cpp` file](https://github.com/WeAreROLI/JUCE/blame/master/modules/juce_gui_extra/native/juce_linux_X11_SystemTrayIcon.cpp) (the Linux implementation of `juce::SystemTrayIconComponent`), much of it was written between 7 and 9 years ago, and relies on the old, traditional system tray support that has, for the most part, been deprecated or removed from recent Linux distributions.

Ubuntu, in particular, developed the AppIndicator system that replaces system tray icons, and generally support for AppIndicators is available on most distros and desktop environments where the system tray is a relic of history. (The “X11” in the filename should also be a red flag — system tray icons aren’t available at all on Wayland, as they rely on X11 calls.) But without AppIndicator support, you’re pretty much stuck.

There are, however, libraries that take great pains to make system tray support transparently cross-platform again — [dorkbox](https://github.com/dorkbox/SystemTray) is one such library. That’s usually the best way to approach using the “system tray” in a cross-platform application.

---

<div class="post-metadata">

**Author:** ![FeRDNYC](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ferdnyc/32/7426_2.png) [@FeRDNYC](https://forum.juce.com/u/FeRDNYC)\
**Post date:** [March 21, 2020, 9:31am UTC](https://forum.juce.com/t/systemtrayiconcomponent-does-not-work-on-ubuntu/38174/3 "2020-03-21T09:31:12Z")

</div>

Er, I should’ve mentioned that dorkbox is a _Java_ library, and therefore not immediately useful in JUCE code. It’s just meant as an example. There are _probably_ C++ equivalents, but I don’t know of any offhand.

---

<div class="post-metadata">

**Author:** ![timur](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/timur/32/541_2.png) [@timur](https://forum.juce.com/u/timur)\
**Post date:** [March 21, 2020, 4:19pm UTC](https://forum.juce.com/t/systemtrayiconcomponent-does-not-work-on-ubuntu/38174/4 "2020-03-21T16:19:18Z")

</div>

That’s interesting @FeRDNYC ! Would you say that the Windows and macOS versions of the JUCE SystemTrayIconComponent are good though?

Do you think it would be feasible to re-implement this JUCE component in C++ on top of the AppIndicator system?
