Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is xdg-open by default available on every linux distribution?

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. I am, however, not certain if xdg-open is by default available on all Linux distro's. Could anyone shed some light on this?

If there is a better alternative I'd like to hear it as well!

Thanks!

like image 619
user4438334 Avatar asked Oct 20 '22 19:10

user4438334


1 Answers

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.

like image 86
Marcus Müller Avatar answered Oct 22 '22 11:10

Marcus Müller