Skip to content

Commit

Permalink
Use xdg-open to open URLs.
Browse files Browse the repository at this point in the history
On GNU/Linux (or similar, non-macOS, non-Windows platforms), when
attempting to open a URL, try using the `xdg-open` command first, before
any other possible browser. This would ensure that the link is open
using the user's preferred browser (assuming a FreeDesktop.org-compliant
desktop environment).

closes #1263
  • Loading branch information
gouttegd committed Feb 24, 2025
1 parent 608b684 commit 61fe161
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else if (OSUtils.isWindows()){
}
else { //assume Unix or Linux
String[] browsers = {
"firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
"xdg-open", "firefox", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
String browser = null;
for (int count = 0; count < browsers.length && browser == null; count++)
if (Runtime.getRuntime().exec(
Expand Down

0 comments on commit 61fe161

Please sign in to comment.