相关文章推荐
叛逆的豌豆  ·  webpack:Unknown ...·  1 月前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm writing a C++ program in which I want to open the user's default browser. For Linux, I found that I can use the xdg-open command. However, is xdg-open available on all Linux distributions by default?

Is there a better alternative?

The answer is obviously "NO", since no text-based distro will have it, and many minimal distros won't have it. Perhaps the question you're looking for is "Can I rely on xdg-open if I want to be portable between RH/CentOS, SuSE, Debian, Ubuntu?" BraveNewCurrency Jan 10, 2015 at 19:29

xdg-open is part of the freedesktop.org suite and is, as far as I know, available to any reasonably generic desktop distribution.

That being said, you can't count on it being available on Android (though that runs a Linux kernel, and thus is a Linux), on something that just displays things on a framebuffer (older navigation systems / HMIs), something that comes without a desktop manager (some kiosk type devices) and of course extremely slimmed down things.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .