I don’t think syncthing has a -browser flag that would let me open it in a different browser. Can someone suggest me what to do, or help me write a script which can generate a headless syncthing instance and then launch it in another browser?
For information, my default browser is Firefox but I want syncthing to start in Surf, to help me save on some resources.
You can’t make syncthing launch a different browser, it always launches the default browser, if you want Surf to be opened, then make surf your default browser and open firefox manually for browsing.
In general, you can make it not start a browser, and manually navigate to 127.0.0.1:8384
No. What would that feature request be for? What about Audrius suggestion of starting syncthing without a browser and then opening the web ui in surf clear/doesn’t work?
You haven’t stated the platform you’re on or what your requirements are, so it’s not really clear what you want.
Still, I’ve made an example bash script that opens surf after launching syncthing. Syncthing is launched in a daemonized screen program and surf is launched in the current shell. Note that when the shell exits, surf is also killed. If you don’t want that behavior you need to specify what your intended behavior is. If you’re already starting syncthing via systemd or something, you should instead modify your systemd script.
#!/bin/bash
screen -dmS syncthing syncthing -no-browser
sleep 5 # Wait for GUI to come online
surf http://127.0.0.1:8384
screen is a program that you may need to install on your system first. It has the nice benefit that it can easily daemonize stuff while also preserving the ability to read/write to stdin/stdout of the process, by attaching or detaching from the screen.
Of course there are many more possibilites, which mostly depends on how you’re starting syncthing. Anway, the general concept is: Launch syncthing, then open your browser.
However that doesn’t work. The command line shows normal output as when I run syncthing by itself, but the surf window never appears.
Another thing I have noticed is that when I run syncthing -no-browser and then surf <required url> as two different commands then everything works just fine.