Martchus / syncthingtray

Tray application and Dolphin/Plasma integration for Syncthing
https://martchus.github.io/syncthingtray/
Other
1.68k stars 44 forks source link

No multiple instances #142

Closed DocMAX closed 2 years ago

DocMAX commented 2 years ago

Can syncthingtray just do nothing if it's allready running? Currently it adds a new tray icon which makes no sense.

Martchus commented 2 years ago

I'm wondering about your use-case. Normally one would expect that a second instance appears when launching an application twice. It would have been nice if you'd used the issue template so I'll have to ask: Is this is about the Qt Widgets based GUI? Note that syncthingtray --trigger allows you to show the current instance's window and syncthingtray --webui to show the current instances's web UI.

DocMAX commented 2 years ago

My usecase is that i sometimes start a second x11 session and syncthingtray is in autostart. After this i have 2 tray icons on my first sessions tray. I can workaround that with a script, to check if syncthingtray is allready running. Yes it's the Qt GUI.

Martchus commented 2 years ago

Ok, that use-case makes sense. How do you autostart Syncthing Tray? Using the option in Syncthing Tray's settings? If that's so I suppose it would indeed make sense to add an option to avoid starting another instance and use that for the autostart. And if you somehow configure the autostart manually you can of course also simply pass that option then.

The only concern is what would happen if one logs in as a different user that also has the autostart enabled (but that might be buggy as-is anyways).

Martchus commented 2 years ago

It is implemented on master, see commits mentioned by GitHub. Note that it doesn't work when you're using a different user because then the whole single instance behavior doesn't work. (I've just fixed it so at least each user can have his own independent single instance.)

Martchus commented 2 years ago

It is implemented as mentioned before. Feel free to reopen if something is missing.