Closed weeksco closed 1 year ago
Current code is:
# launch web-browser
if sys.platform.startswith("darwin"):
cmd = [shutil.which("open")]
elif sys.platform.startswith("win"):
cmd = ["start"]
else:
cmd = [shutil.which("x-www-browser")]
Changing that to
# launch web-browser
if sys.platform.startswith("darwin"):
cmd = [shutil.which("open")]
elif sys.platform.startswith("win"):
cmd = ["start"]
else:
cmd = [shutil.which("xdg-open")]
Would that fix it everywhere? Would that break it on different Linux distributions?
Ok, finally I decided to do the following:
# launch web-browser
if sys.platform.startswith("darwin"):
cmd = [shutil.which("open")]
elif sys.platform.startswith("win"):
cmd = ["start"]
else:
cmd = [shutil.which("xdg-open")]
if cmd == [None]:
cmd = [shutil.which("x-www-browser")]
See new version, it tries xdg-open
first, if that fails as fallback it tries x-www-browser
.
@weeksco Please report back if that works for you now.
Perfect! Many thanks
Great tool, just one small issue for me on first run:
SSO login fails with "E231: Browser could not be launched" on Manjaro Sway because x-www-browser does not exist.
I could work around this with a symlink in my path e.g. "ln -s /usr/bin/chromium .local/bin/x-www-browser"
Maybe xdg-open could be used instead?
Thanks and keep up the great work