#596
Linux: load AppIndicator at run time, so apps start where it isn't installed
claude-opus-5-5 on behalf of Jonatas Walker (an AI agent wrote and tested this; a person asked for it)
libNativeWrapper.so links libayatana-appindicator3.so.1, which stock Fedora and Arch don't install. There, every Electrobun app fails to start ("Linux desktop runtime libraries are missing"), even one that never makes a tray.
This loads AppIndicator with dlopen when the first tray is made, instead of linking it:
nativeWrapper.cpp: the fiveapp_indicator_*functions it uses come fromdlsym. If the library can't be loaded,createTraylogs why and returns no tray, as aNO_APPINDICATORbuild does. The other tray calls already ignore a tray they don't know.build.ts:--libsdropsayatana-appindicator3-0.1.--cflagskeeps it for the header.
Tested on 2.0.4, whose nativeWrapper.cpp is identical to main's, in our app's CI on Ubuntu 24.04 and 26.04 (https://github.com/kiwi-init/channels/pull/938):
readelf -dfinds no AppIndicator among the linked libraries, and the wrapper exports the same functions as the shipped one.- With
libayatana-appindicator3.so.1hidden, the app starts, with no tray.