From 5994e44877e043a83faf7f4ddfea7cee338e3f13 Mon Sep 17 00:00:00 2001 From: Matti Viljanen Date: Fri, 18 Mar 2022 02:08:30 +0200 Subject: [PATCH] Fix launching fish_config on SailfishOS --- share/tools/web_config/webconfig.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index c5b5290ab..280db332d 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -81,6 +81,16 @@ def is_wsl(): return False +def is_sailfish_os(): + """ Return whether we are running on Sailfish OS """ + if "linux" in platform.system().lower() and os.access("/etc/sailfish-release", os.R_OK): + with open("/etc/sailfish-release", "r") as f: + # Find 'ID=sailfishos' + if "sailfishos" in f.read(): + return True + return False + + def is_termux(): """ Return whether we are running under the Termux application for Android""" return "com.termux" in os.environ["PATH"] and find_executable("termux-open-url") @@ -1637,7 +1647,7 @@ def runThing(): sys.exit(-1) elif is_termux(): subprocess.call(["termux-open-url", url]) - elif is_chromeos_garcon(): + elif is_chromeos_garcon() or is_sailfish_os(): webbrowser.open(url) else: webbrowser.open(fileurl)