Is xdg-open available by default for every Linux distribution?

I am 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, I'm not sure if xdg-open is available by default for all Linux distributions. Can anyone shed some light on this?

If there is a better alternative, I'd love to hear it too!

Thank!

+3


source to share


2 answers


xdg-open is part of the freedesktop.org package and as far as I know is available for any fairly common desktop distribution.



If you think you cannot count on being available on Android (although it runs the Linux kernel and therefore is Linux), something that just displays things in the framebuffer (older navigation systems / HMI ) something that comes without a desktop manager (some kiosk type devices) and is of course extremely slimmed down.

+1


source


If it xdg-open

doesn't work, on some Linux distributions (especially Debian style) you can try /usr/bin/x-www-browser

.



0


source







All Articles