jaystrictor / gnome-shell-extension-syncthing

GNU General Public License v3.0
87 stars 14 forks source link

Feature Request: Autostart Syncthing #59

Open cxt666 opened 3 years ago

cxt666 commented 3 years ago

Request: Add an option to the Syncthing Icon Configuration "Launch Syncthing on Startup"

Expected behavior: Activating the "Launch Syncthing on Startup" Option would automatically activate Syncthing after the Syncthing Icon has been loaded in a Gnome Session.

Use Case: On my Desktop PC, I manually start Syncthing via the Syncthing icon every time after login. The Option "Launch Syncthing on Startup" would take away the need to manually do this and in many cases synchronize any changes to my folders between logging in to Gnome and starting to work. Launch Synchting on Startup

jaystrictor commented 3 years ago

The extension uses systemd user services, so

systemctl --user enable syncthing.service

should do just what you want.

Also take a look at loginctl enable-linger.

cxt666 commented 3 years ago

Would it be possible to

jaystrictor commented 3 years ago

Would it be possible to

* Query the systemctl status like `systemctl --user list-unit-files | grep syncthing.service` and display the Result on the Slider

I am not sure what you are trying to accomplish with that command. Maybe it would be easier to use

/bin/systemctl --user show -p LoadState -p ActiveState -p UnitFileState syncthing.service

Take a look at src/systemd.js.

* Set _Enabled_ through `systemctl --user enable syncthing.service`

* Set _Disabled_ through `systemctl --user disable syncthing.service`

That would certainly be possible. Someone has to implement that, but I am short on time right now. I would accept pull requests for that, though.