Skip to content

[reference] Use xdg-open instead of firefox#10

Open
iacore wants to merge 1 commit into
ThomasMertes:masterfrom
iacore:patch-openbrowser
Open

[reference] Use xdg-open instead of firefox#10
iacore wants to merge 1 commit into
ThomasMertes:masterfrom
iacore:patch-openbrowser

Conversation

@iacore
Copy link
Copy Markdown

@iacore iacore commented Jul 25, 2022

When I used ide7, I noticed it's not showing anything. I tried to fix opening browser on Linux, but I don't know Seed7 enough.

On Linux, opening browser should be like this:

  • use xdg-open http://example.com/ (free desktop)
  • run $BROWSER http://example.com/ if env var BROWSER exist
  • hardcoded browser paths

Also, I noticed this function will not fail if non of the browser exist (browser.program is empty).

@Wolf-SO
Copy link
Copy Markdown

Wolf-SO commented Apr 4, 2025

To my knowledge, xdg-open is the

[...] command in the Linux system is used to open a file or URL in the user’s preferred application.

And this command is part of the xdg-utils package. So we must check first if this package is installed. Also, we need to get the result of the startProcess to be stored in browser.program while your (@iacore ) cmd_sh only does part of this task.

If this package is installed, we can get the default web browser like this:

xdg-settings get default-web-browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants