syncthingtray icon indicating copy to clipboard operation
syncthingtray copied to clipboard

LXQt: Tray starts, but I have to manually connect it to the Syncthing service

Open maxkapur opened this issue 11 months ago • 1 comments

Thanks for this excellent system tray integration!

Relevant components

  • [x] Standalone tray application (based on Qt Widgets)
  • [ ] Plasmoid/applet for Plasma desktop
  • [ ] Dolphin integration
  • [ ] Command line tool (syncthingctl)
  • [ ] Integrated Syncthing instance (libsyncthing)
  • [ ] Backend libraries

Environment and versions

  • Versions of syncthingtray, qtutilities and c++utilities: 1.3.2-2, 6.10.0-1, 5.20.0-1 (all as shown in apt info)
  • Qt version: 5.15.10
  • LXQt Version: 1.3.0
  • C++ compiler (name and version): n/a
  • C++ standard library (name and version): n/a
  • Operating system (name and version): Lubuntu 23.10

Bug description

I have syncthingtray installed and working in Lubuntu 23.10, which uses the LXQt desktop environment. Though the tray itself works, it fails to connect to my Syncthing instance, and remains on the gray icon with tooltip

Not connected to Syncthing
Trying again every 30000 ms

when I hover over it. What's weird is, if I click the tray icon and click Connect manually, it finds my Syncthing service and connects instantly, showing all of my folders etc. as expected. So something about the "connect" action wired to the button is working more effectively than the "connect" action that syncthingtray claims it is trying automatically every 30 s.

I start Syncthing itself with a systemd user service ([email protected]), and I start syncthingtray using a .desktop entry (see below).

Steps to reproduce

  1. Install Lubuntu 23.10
  2. Install Syncthing using apt, set up the Syncthing user systemd service, and add some sync folders.
  3. Install syncthingtray with apt
  4. Set up syncthingtray to autostart (using LXQt GUI, or just paste in the .desktop file below)
  5. Reboot, log back in

Expected behavior

syncthingtray automatically starts and connects to the running Syncthing instance.

Actual behavior

syncthingtray starts, but I have to click on it and click Connect for it to find the Syncthing service.

Additional context

I have read the Configuring systemd integration section of the README and my setup appears to have everything that's required. Syncthing runs as a user (not system) unit and org.freedesktop.systemd1 appears in busctl (I haven't made any changes to the systemd configuration that ships with Lubuntu).

Here is the ~/.config/autostart/syncthingtray.desktop entry:

[Desktop Entry]
Comment=Tray application for Syncthing
Exec=\\"/usr/bin/syncthingtray\\" qt-widgets-gui --single-instance --wait
Icon=syncthingtray
Name=Syncthing Tray
Terminal=false
Type=Application
X-GNOME-Autostart-Delay=0
X-GNOME-Autostart-enabled=true
X-LXQt-Need-Tray=true

The --wait option I added to syncthingtray in an attempt to solve the problem reported here, but makes no difference. The X-LXQt-Need-Tray=true option does appear to be necessary—without it, I get nothing in the system tray at all.

And here is ~/.config/syncthingtray.ini:

[General]
v=1.3.2

[qt]
customfont=false
customicontheme=false
customlocale=false
custompalette=false
customstylesheet=false
customwidgetstyle=false
font="Ubuntu,11,-1,5,50,0,0,0,0,0"
icontheme=ePapirus
iconthemepath=
locale=en_US
palette="@Variant(\0\0\0\x44\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff\xef\xef\xef\xef\xef\xef\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xff\xf7\xf7\xf7\xf7\xf7\xf7\0\0\x1\x1\xff\xffw\xf7w\xf7w\xf7\0\0\x1\x1\xff\xff\x9f\xf4\x9f\xf4\x9f\xf4\0\0\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xff\xef\xef\xef\xef\xef\xef\0\0\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff<<\x8c\x8c\xe6\xe6\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xff))\x80\x80\xb9\xb9\0\0\x1\x1\xff\xff\x9b\x9bYY\xb6\xb6\0\0\x1\x1\xff\xff\xf7\xf7\xf7\xf7\xf7\xf7\0\0\x1\x1\xff\xffw\xf7w\xf7w\xf7\0\0\x1\x1\xff\xff\xef\xef\xef\xef\xef\xef\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xff\xf7\xf7\xf7\xf7\xf7\xf7\0\0\x1\x1\xff\xffw\xf7w\xf7w\xf7\0\0\x1\x1\xff\xff\x9f\xf4\x9f\xf4\x9f\xf4\0\0\x1\x1\xff\xffw\xf7w\xf7w\xf7\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xffw\xf7w\xf7w\xf7\0\0\x1\x1\xff\xff\xef\xef\xef\xef\xef\xef\0\0\x1\x1\xff\xff\xef\xef\xef\xef\xef\xef\0\0\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff<<\x8c\x8c\xe6\xe6\0\0\x1\x1\xff\xff\xa0\x63\xa2\x3\xa3\xa4\0\0\x1\x1\xff\xff\xa4\x13\xca\xbb\xe2\xf8\0\0\x1\x1\xff\xff\xd6\x94\xba=\xe1\xe9\0\0\x1\x1\xff\xff\xef\xef\xef\xef\xef\xef\0\0\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff\xef\xef\xef\xef\xef\xef\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xff\xf7\xf7\xf7\xf7\xf7\xf7\0\0\x1\x1\xff\xffw\xf7w\xf7w\xf7\0\0\x1\x1\xff\xff\x9f\xf4\x9f\xf4\x9f\xf4\0\0\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x1\x1\xff\xff\xef\xef\xef\xef\xef\xef\0\0\x1\x1\xff\xff\0\0\0\0\0\0\0\0\x1\x1\xff\xff<<\x8c\x8c\xe6\xe6\0\0\x1\x1\xff\xff##&&))\0\0\x1\x1\xff\xff))\x80\x80\xb9\xb9\0\0\x1\x1\xff\xff\x9b\x9bYY\xb6\xb6\0\0\x1\x1\xff\xff\xf7\xf7\xf7\xf7\xf7\xf7\0\0)"
plugindir=
stylesheetpath=
trpath=
widgetstyle=

[startup]
considerForReconnect=true
considerLauncherForReconnect=false
showButton=true
showLauncherButton=false
syncthingArgs="-no-browser -no-restart -logflags=3"
syncthingAutostart=false
syncthingPath=syncthing
syncthingUnit=syncthing.service
systemUnit=false
useLibSyncthing=false

[tray]
connections\1\apiKey=@ByteArray(...)
connections\1\authEnabled=false
connections\1\autoConnect=false
connections\1\devStatsPollInterval=60000
connections\1\errorsPollInterval=30000
connections\1\httpsCertPath=
connections\1\label=Primary instance
connections\1\password=
connections\1\reconnectInterval=30000
connections\1\statusComputionFlags=59
connections\1\syncthingUrl=http://127.0.0.1:8384
connections\1\trafficPollInterval=5000
connections\1\userName=
connections\size=1
dbusNotifications=true
distinguishTrayIcons=false
frameStyle=16
ignoreInavailabilityAfterStart=15
notifyOnDisconnect=true
notifyOnErrors=true
notifyOnLauncherErrors=true
notifyOnLocalSyncComplete=false
notifyOnNewDeviceConnects=false
notifyOnNewDirectoryShared=false
notifyOnRemoteSyncComplete=false
positioning\assumedIconPos=@Point(0 0)
positioning\useAssumedIconPosition=false
positioning\useCursorPos=true
preferIconsFromTheme=false
showSyncthingNotifications=true
showTabTexts=true
showTraffic=true
statusIcons="#ff26b6db,#ff0882c8,#ffffffff;#ffdb3c26,#ffc80828,#ffffffff;#ffc9ce3b,#ffebb83b,#ffffffff;#ff2d9d69,#ff2d9d69,#ffffffff;#ff26b6db,#ff0882c8,#ffffffff;#ff26b6db,#ff0882c8,#ffffffff;#ffa9a9a9,#ff58656c,#ffffffff;#ffa9a9a9,#ff58656c,#ffffffff"
statusIconsRenderSize=@Size(32 32)
statusIconsStrokeWidth=0
tabPos=1
trayIcons="#ff26b6db,#ff0882c8,#ffffffff;#ffdb3c26,#ffc80828,#ffffffff;#ffc9ce3b,#ffebb83b,#ffffffff;#ff2d9d69,#ff2d9d69,#ffffffff;#ff26b6db,#ff0882c8,#ffffffff;#ff26b6db,#ff0882c8,#ffffffff;#ffa9a9a9,#ff58656c,#ffffffff;#ffa9a9a9,#ff58656c,#ffffffff"
trayIconsRenderSize=@Size(32 32)
trayIconsStrokeWidth=0
trayMenuSize=@Size(575 475)
windowed=false

[webview]
disabled=false
geometry=@ByteArray()
keepRunning=true
zoomFactor=1

maxkapur avatar Mar 15 '24 11:03 maxkapur

You have considerForReconnect=true in your [systemd] settings and configured syncthingUnit=syncthing.service. That's not the systemd unit you claim to use so it makes sense for Syncthing Tray to assume the unit is not started and avoid any connection attempts. Works as intended I'd say.

I don't know the exact details of your setup but I suppose you'll have to configure [email protected] as the systemd unit name in Syncthing Tray's settings and tick the checkbox for the unit being a system unit as it is probably not a user unit (see remark below). If you've configured it right the UI of Syncthing Tray's settings will show the unit description and status correctly.


Install Lubuntu 23.10

Sorry, but I can't spend the effort of installing a particular OS.


Versions of syncthingtray, qtutilities and c++utilities: 1.3.2-2, 6.10.0-1, 5.20.0-1 (all as shown in apt info)

I also cannot take the effort of supporting older versions. If there's really a bug it might have already been fixed. So please upgrade and test again if my suggestion doesn't help. If there's no package for your platform you'll need to compile one yourself. Maybe the binary in the release section on GitHub works as well.


I start Syncthing itself with a systemd user service ([email protected])

That is most likely a self-contradicting statement. If you're using [email protected] then this would probably not be a systemd user service started/controlled via systemctl --user … because those services are usually just called syncthing.service (without the user name as parameter).


Here is the ~/.config/autostart/syncthingtray.desktop entry:

Ok, so you have self-crafted a *.desktop entry because the one created by Syncthing Tray's settings doesn't work on LXQt. I suppose I can enhance Syncthing Tray's settings to add X-LXQt-Need-Tray=true and --wait to support LXQt as well. This issue is of course separate from the connection problems.

Martchus avatar Mar 15 '24 12:03 Martchus

  • Versions of syncthingtray, qtutilities and c++utilities: 1.3.2-2, 6.10.0-1, 5.20.0-1 (all as shown in apt info) [snip Operating system (name and version): Lubuntu 23.10

Lubuntu 23.10 is EOL as of this month and has no security support. Please upgrade to 24.04 ASAP. https://ubuntu.com/about/release-cycle

I have syncthingtray installed and working in Lubuntu 23.10, which uses the LXQt desktop environment. Though the tray itself works, it fails to connect to my Syncthing instance, and remains on the gray icon with tooltip

Not connected to Syncthing
Trying again every 30000 ms

when I hover over it. What's weird is, if I click the tray icon and click Connect manually, it finds my Syncthing service and connects instantly, showing all of my folders etc. as expected. So something about the "connect" action wired to the button is working more effectively than the "connect" action that syncthingtray claims it is trying automatically every 30 s.

I confirm this bug existed in SyncthingTray 1.3.2 and/or its dependencies and I seem to remember that it was fixed in one of the last three of four Debian releases (I'm the Debian maintainer of this package, by the way). Sadly I can't remember if 1.4.12 (the version in LUbuntu 24.04) has the fix.

Would you please upgrade to 24.04 and update this issue with your experience?

@Martchus Thank you for adding the LXQt quirk!

sten0 avatar Jul 29 '24 18:07 sten0

@Martchus P.S. Yes, this was an upstream bug and not a Debian-specific one ;)

sten0 avatar Jul 29 '24 18:07 sten0

Yes, and I think https://github.com/Martchus/syncthingtray/commit/6b7d9169142936a42f2eb614981d4ab09980abdb is all I can do about it. So I'm closing the issue now considering I haven't gotten a response for months from the ticket author.

Martchus avatar Jul 30 '24 08:07 Martchus