use xdg-open to open url on Linux
This commit is contained in:
parent
4b2f9d6080
commit
edb9abc546
|
|
@ -35,11 +35,9 @@ bool open_url( const char* url ){
|
|||
#if defined( __linux__ ) || defined( __FreeBSD__ )
|
||||
#include <stdlib.h>
|
||||
bool open_url( const char* url ){
|
||||
// \todo FIXME: the way we open URLs on *nix should be improved. A script is good (see how I do on RTCW)
|
||||
//Fedora 25: Help > Manual leads to "sh: firefox: command not found" error on terminal, while xdg-open http://some/url/ works just fine (and opens up the URL in the web browser)
|
||||
char command[2 * PATH_MAX];
|
||||
snprintf( command, sizeof( command ),
|
||||
"firefox -remote \"openURL(%s,new-window)\" || firefox \"%s\" &", url, url );
|
||||
"xdg-open \"%s\" &", url );
|
||||
return system( command ) == 0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user