Index: trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java	(revision 6681)
+++ trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java	(revision 6682)
@@ -59,4 +59,7 @@
                     // Desktop API works fine under Windows, so we don't try any fallback in case of I/O exceptions because it's not API's fault
                     Desktop.getDesktop().browse(uri);
+                } else if (Main.platform instanceof PlatformHookUnixoid) {
+                    // see #5629 #5108 #9568
+                    Main.platform.openUrl(uri.toString());
                 } else {
                     // This is not the case with some Linux environments (see below), and not sure about Mac OS X, so we need to handle API failure
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 6681)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 6682)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Desktop;
 import java.awt.Dimension;
 import java.awt.GraphicsEnvironment;
@@ -12,4 +13,6 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.Arrays;
 
@@ -41,10 +44,19 @@
     @Override
     public void openUrl(String url) throws IOException {
-        String[] programs = {"gnome-open", "kfmclient openURL", "firefox"};
-        for (String program : programs) {
+        for (String program : Main.pref.getCollection("browser.unix",
+                Arrays.asList("xdg-open", "#DESKTOP#", "$BROWSER", "gnome-open", "kfmclient openURL", "firefox"))) {
             try {
-                Runtime.getRuntime().exec(program+" "+url);
+                if ("#DESKTOP#".equals(program)) {
+                    Desktop.getDesktop().browse(new URI(url));
+                } else if (program.startsWith("$")) {
+                    program = System.getenv().get(program.substring(1));
+                    Runtime.getRuntime().exec(new String[]{program, url});
+                } else {
+                    Runtime.getRuntime().exec(new String[]{program, url});
+                }
                 return;
             } catch (IOException e) {
+                Main.warn(e);
+            } catch (URISyntaxException e) {
                 Main.warn(e);
             }
