title: How to check system tray availability programmatically?
body: <p>Upon launching <a href="https://github.com/sieren/QSyncthingTray" rel="nofollow noreferrer"><code>QSyncthingTray</code></a> without any panel/trayer running, it displays an error dialog:</p>
  <pre><code>I couldn't detect any system tray on this system.
                                           [ OK ]
  </code></pre>
  <p>and exits upon pressing <code>[ OK ]</code>.</p>
  <p><em>Curiously though, if I have <code>QSyncthingTray</code> already running as a tray icon and kill my panel, <code>QSyncthingTray</code> doesn't quit, and upon restarting the panel <code>QSyncthingTray</code> is still there...</em></p>
  <p>For my <code>~/.xsession</code> &amp; <code>~/.xinitrc</code> startup, I'd like to add a looped check whether a tray is present, pseudocode:</p>
  <pre><code>loop:
    if system-tray.is-available:
      run QSyncthingTray
      done
    else sleep 1
  </code></pre>
  <p>How do I do the <code>if system-tray.is-available</code>?<br />
  The preferable language is <a href="https://www.perl.org/" rel="nofollow noreferrer"><code>Perl</code></a>, also interested in <a href="https://raku.org/" rel="nofollow noreferrer"><code>Raku</code></a> and POSIX <code>sh</code>.
  Other languages are welcome as well.</p>