Trigger AnkiWeb sync from Linux command line

I never tried to run a flatpak from a cron job, but maybe the following could help you a bit?

  1. Maybe you need to setup QT_QPA_PLATFORM_PLUGIN_PATH, so that the app can find the plugins? It apparently often points to /var/lib/flatpak/app/<app-id>/current/active/files/lib/qt6/plugins/platform.
  2. Maybe flatpak-spawn can be used?
  3. Maybe compare the env output of your cron job and your regular user to find differences?
  4. Apparently some users could use cron if the flatpak was installed with --user (rather than --system) – though their issue was with using the flatpak update command.