Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 6 tasks
maxkapur opened this issue Mar 15, 2024 · 1 comment
Open
1 of 6 tasks

Comments

@maxkapur
Copy link

maxkapur commented Mar 15, 2024

Thanks for this excellent system tray integration!

Relevant components

  • 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
(syncthing@max.service), 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
@Martchus
Copy link
Owner

Martchus commented Mar 15, 2024

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 syncthing@max.service 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 (syncthing@max.service)

That is most likely a self-contradicting statement. If you're using syncthing@max.service 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 added a commit that referenced this issue Mar 15, 2024
* 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
  #240); this is in-line
  with the autostart entry of https://github.com/lxqt/lxqt-powermanagement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants