Hi all -- xdg-open dies unhappily on OS X because $BROWSER is not set in the standard configuration, and it can't find any browser in an expected location. I found the following elegant solution: setenv BROWSER open because there is a standard OS X command for this sort of thing (passes URLs to user's choice of webbrowser, opens documents in corresponding application) e.g. `open http://www.apple.com/`. Perhaps a nice default if $BROWSER is not set but on OS X (e.g. $OSTYPE = darwin, or `uname` = Darwin) is to just pass the URL along to `open`. -Jeff
This is version 1.0.1 by the way.
What would help (esp coming from someone with access and knowledge of OSX), 1. A scriptable way to identify osx platform. for example, see detectDE() function in xdg-open. 2. For osx platform, suggested values for $BROWSER , or even suggested specialized open_osx function(s).
Rex -- I thought I provided answers to both of these questions? My sh coding skils are too rusty to supply entire code fragments, but you can identify OS X by the $OSTYPE environment variable or by the output of `uname`, and by far the most sensible value for $BROWSER is simply "open" which will recognize a URL commandline argument and pass it to the user's default browser. Hopefully that's enough info for someone else to code it up. -Jeff
ok, if uname output is indeed 'Darwin' , we can utilize that.
Thanks! http://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=ca33e673f7fd9173267843aac9668f692d48d6da
So far, this only implements the mapping of xdg-open => open on Darwin platform, and doesn't touch any other utilities. There's further work to be done to integrate the other bits. One thing we could consider is setting BROWSER=open in the meantime as suggested (but not implemented).
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.