Upon launching QSyncthingTray without any panel/trayer running, it displays an error dialog:
I couldn't detect any system tray on this system.
[ OK ]
and exits upon pressing [ OK ].
Curiously though, if I have QSyncthingTray already running as a tray icon and kill my panel, QSyncthingTray doesn't quit, and upon restarting the panel QSyncthingTray is still there...
For my ~/.xsession & ~/.xinitrc startup, I'd like to add a looped check whether a tray is present, pseudocode:
loop:
if system-tray.is-available:
run QSyncthingTray
done
else sleep 1
How do I do the if system-tray.is-available?
The preferable language is Perl, also interested in Raku and POSIX sh.
Other languages are welcome as well.
QSyncthingTrayuses isSystemTrayAvailable() from Qt c++ lib.You can do the same.
is_tray_available.cpp:QT is unique in that you need to use a full-blown build system to build programs using it:
is_tray_available.pro:Save both files in the same dir, execute
qmake,makeand voilĂ , you have an executable that you can use in a shell script.