Make autostart entry for GNU/Linux more robust

* Add `--wait` parameter so Syncthing Tray will wait until the tray becomes
  available; this might help if Syncthing Tray is started by the desktop
  environment before the tray is available (unless it is started too soon
  even for that)
* Add `X-LXQt-Need-Tray=true` to ensure the system tray is available on
  LXQt because just `--wait` might not be sufficient here (according to
  https://github.com/Martchus/syncthingtray/issues/240); this is in-line
  with the autostart entry of https://github.com/lxqt/lxqt-powermanagement
This commit is contained in:
Martchus 2024-03-16 00:14:44 +01:00
parent a16a343639
commit 6b7d916914
1 changed files with 3 additions and 2 deletions

View File

@ -922,12 +922,13 @@ bool setAutostartPath(const QString &path)
"Name=" APP_NAME "\n"
"Exec=\"");
desktopFile.write(path.toUtf8());
desktopFile.write("\" qt-widgets-gui --single-instance\nComment=" APP_DESCRIPTION "\n"
desktopFile.write("\" qt-widgets-gui --single-instance --wait\nComment=" APP_DESCRIPTION "\n"
"Icon=" PROJECT_NAME "\n"
"Type=Application\n"
"Terminal=false\n"
"X-GNOME-Autostart-Delay=0\n"
"X-GNOME-Autostart-enabled=true");
"X-GNOME-Autostart-enabled=true\n"
"X-LXQt-Need-Tray=true\n");
return desktopFile.error() == QFile::NoError && desktopFile.flush();
} else {