From 7d2ce46757a2ae7e0492ee144691a0bc15d62ffa Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Thu, 7 Nov 2013 18:52:40 +0100 Subject: [PATCH] First try gnome-open and use xdg-open as fallback, to open openweathermap.org in browser. --- src/extension.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/extension.js b/src/extension.js index c0da3b9..2ebf792 100644 --- a/src/extension.js +++ b/src/extension.js @@ -248,7 +248,16 @@ const WeatherMenuButton = new Lang.Class({ if (this._appid) url += "?APPID=" + this._appid; - Util.spawn(["gnome-open", url]); + try { + Util.trySpawn(["gnome-open", url]); + } catch (err) { + try { + Util.trySpawn(["xdg-open", url]); + } catch (err) { + let title = _("Execution of 'gnome-open' and 'xdg-open' failed.\nCan not open %s").format(url); + Main.notifyError(title, err.message); + } + } })); this.menu.addMenuItem(item);