DesktopFile.startApplication

Starts the application associated with this .desktop file using urls as command line params. If the program should be run in terminal it tries to find system defined terminal emulator to run in.

  1. Pid startApplication(string[] urls, string locale, const(string)[] terminalCommand)
    class DesktopFile
    @trusted const
    Pid
    startApplication
    (
    in string[] urls = null
    ,
    string locale = null
    ,
    lazy const(string)[] terminalCommand = getTerminalCommand
    )
  2. Pid startApplication(string url, string locale, const(string)[] terminalCommand)

Parameters

urls string[]

urls application will start with.

locale string

locale that may be needed to be placed in urls if Exec value has %c code.

terminalCommand const(string)[]

preferable terminal emulator command. If not set then terminal is determined via getTerminalCommand. Note: This function does not check if the type of desktop file is Application. It relies only on "Exec" value.

Return Value

Type: Pid

Pid of started process.

Throws

ProcessException on failure to start the process. DesktopExecException if exec string is invalid.

Examples

auto df = new DesktopFile();
assertThrown(df.startApplication(string[].init));

See Also

getTerminalCommand, start, expandExecString

Meta