open-browser-0.1.1.0: lib/Network/Browser/Linux.hs
module Network.Browser.Linux
( openBrowserLinux
) where
import System.Exit (ExitCode(..))
import System.Process (rawSystem)
openBrowserLinux :: String -> IO Bool
openBrowserLinux url = exitCodeToBool `fmap` rawSystem executable argv
where (executable, argv) = ("xdg-open", [url])
exitCodeToBool ExitSuccess = True
exitCodeToBool (ExitFailure _) = False