diff --git a/meshtastic-client_1.0.202511241837_amd64.deb b/meshtastic-client_1.0.202511241837_amd64.deb new file mode 100644 index 0000000..6b095b9 Binary files /dev/null and b/meshtastic-client_1.0.202511241837_amd64.deb differ diff --git a/meshtastic_client.py b/meshtastic_client.py index 93a6bd3..4d38c72 100644 --- a/meshtastic_client.py +++ b/meshtastic_client.py @@ -46,17 +46,40 @@ ICON_PATH = PROJECT_PATH / "meshtastic.ico" def _prefer_chrome(url: str): - # try Chrome first - chrome_paths = [ - r"C:\Program Files\Google\Chrome\Application\chrome.exe", - r"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", + """Open URL in a sensible browser on any OS. + On Flatpak/Linux we just use the default handler. + """ + # Try system default browser first (works well in Flatpak) + try: + webbrowser.open(url) + return + except Exception: + pass + + # Fallbacks for some common desktop setups + candidate_browsers = [ + # Linux / BSD + "xdg-open", + "gio open", + "sensible-browser", + "google-chrome-stable", + "chromium", + # Windows (if someone still runs it there) + r"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", + r"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", ] - for p in chrome_paths: - if os.path.exists(p): - subprocess.Popen([p, url]) - return - # fallback - webbrowser.open(url) + + for cmd in candidate_browsers: + try: + if os.path.isabs(cmd) and os.path.exists(cmd): + subprocess.Popen([cmd, url]) + return + else: + # Let the shell resolve it from PATH + subprocess.Popen(cmd.split() + [url]) + return + except Exception: + continue def _fmt_ago(epoch_seconds: Optional[float]) -> str: