#5629 closed enhancement (duplicate)
[Patch] Use xdg-open first for opening links
| Reported by: | quazgar | Owned by: | team |
|---|---|---|---|
| Priority: | minor | Component: | unspecified |
| Version: | latest | Keywords: | |
| Cc: |
Description (last modified by simon04)
Currently gnome-open is used as the first helper application to open links, regardless of which window manager is used.
The attached patch used xdg-open (from freedesktop.org) as the first try. If that fails, the other alternatives are used in the order used before. This should work for all modern window managers equally well.
I suggest applying this patch to the current source, I tried & tested it with latest svn (3652), it compiles and runs fine.
Attachments (1)
Change History (8)
Changed 3 years ago by quazgar
comment:1 Changed 3 years ago by stoecker
- Summary changed from Patch: Use xdg-open first for opening links to [Patch] Use xdg-open first for opening links
comment:2 follow-up: ↓ 3 Changed 3 years ago by bastiK
See #5108.
The code you patched is not executed under normal circumstances.
From OpenBrowser.java:
if (Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(uri);
} catch (Exception e) {
e.printStackTrace();
return e.getMessage();
}
} else {
System.err.println("Warning: Desktop class is not supported. Platform dependent fall back for open url in browser.");
if (Main.platform == null)
throw new IllegalStateException(tr("Failed to open URL. There is currently no platform set. Please set a platform first."));
try {
Main.platform.openUrl(uri.toString());
} catch (IOException e) {
return e.getMessage();
}
}
Desktop.isDesktopSupported() should return true on all modern platforms.
Maybe like this:
(1) xdg-open
(2) Desktop.getDesktop().browse()
(3) gnome-open, kfmclient openURL, firefox
comment:3 in reply to: ↑ 2 Changed 3 years ago by anonymous
Replying to bastiK:
See #5108.
The code you patched is not executed under normal circumstances.
From OpenBrowser.java:
...
True, I didn't check if gnope-open was still used here with the latest svn version :) I just experienced the mentioned problem with the version I had installed (r3514), but the mentioned change seems to have been done in r3524.
Maybe like this:
(1) xdg-open
(2) Desktop.getDesktop().browse()
(3) gnome-open, kfmclient openURL, firefox
If someone wants to implement this order, I'd really welcome it, but it's no high priority for me any more :)
I'm just not sure though if all supported Desktops porperly configure, so maybe it should be simply
(1) Desktop.getDesktop().browse()
(2) xdg-open, gnome-open, kfmclient openURL, firefox
I would rather leave this decision to desktop environment experts though.
comment:4 Changed 3 years ago by bastiK
- Resolution set to duplicate
- Status changed from new to closed
comment:5 Changed 3 years ago by bastiK
Closed as duplicate of #5108.
comment:6 Changed 4 months ago by anonymous
Please merge this patch. I understand that this code does not execute for a large percentage of your users, but it's 12 bytes, and helps those of us with unusual window managers (like me, and the person who sent in the patch.)
comment:7 Changed 4 months ago by simon04
- Description modified (diff)
+1. xdg-open seems to be standard for opening files by extension under Linux.



Patch to implement the proposed change