syncthing-gtk
syncthing-gtk copied to clipboard
Make Syncthing-GTK able to run/shutdown Syncthing snap package
I run syncthing as a snap on my Ubuntu 17.10 laptop and it's working fine with Syncthing-GTK, except for starting Syncthing daemon from your app. So I must start the daemon independently, which I do, but I thing it would be better if that would be possible from your within application. (maybe it is but I just couldn't wind out the proper way to do it?)
How are you starting Syncthing daemon installed in snap?
snap run syncthing
(without sudo)
And do you happen to know where does syncthing stores its configuration when started like that? :D
all the files that are usually located in /home/USER/.config/syncthing are in snap version located in /home/USER/snap/syncthing/common/syncthing
So, with this, ST-GTK will not start with 1st run wizard if there is snap config present, but it will popup dialog about /usr/bin/syncthing not being found and you'll have to set executable to snap run syncthing
manually, as there doesn't seem to be any way how to tell that there is one installed.
The snap installation adds /snap/bin/syncthing (which should be added to the users path if snapd is installed). Can not this simply be added as a secondary binary search location?
Frankly, I don't really know enough about snaps to tell if that should or will work and I don't have any machine capable of testing it right now. But if someone feels like testing it and creating PR, it is welcomed :)
I looked a bit into it. ST-GTK finds the syncthing snap binary just fine.
The problem left is, that ST-GTK tries to write the syncthing configuration files to ~/.config/syncthing but the snap does not have write access to this directory.
The correct configuration dir for syncthing as a snap would be ~/snap/syncthing/common/syncthing. Unfortunately ST-GTK uses the get_config_dir() function from the tools.py to also find it's own configuration directory (which is still under ~/.config). So no easy fix that way.
@kozec can you estimate what changes would be necessary to fix the issue?
Thanks a lot for your work!
#449 made a pull request