Top | ![]() |
![]() |
![]() |
![]() |
|
findUrls () |
|
spawn () |
|
spawn_async () |
|
spawnCommandLine () |
|
trySpawn () |
|
trySpawnCommandLine () |
|
spawnCommandLineAsync () |
|
killall () |
|
latinise () |
|
queryCollection () |
|
getGObjectPropertyValues () |
This file includes certain useful utility functions such as running external commands. It is generally a good idea to use the functions defined here instead of tapping into GLib directly since this adds some wrappers around the functions that make them more Cinnamon-friendly and provides helpful error messages.
findUrls (str
);
Searches str
for URLs and returns an array of objects with url
properties showing the matched URL string, and pos
properties indicating the position within str
where the URL was found.
spawn (argv
);
Runs argv
in the background, handling any errors that occur when trying to start the program.
spawn_async (args
,callback
);
Asynchronously Runs the command passed to args
. When the command is complete, the callback will be called with the contents of stdout from the command passed as the only argument.
spawnCommandLine (command_line
);
Runs command_line
in the background, handling any errors that occur when trying to parse or start the program.
trySpawn (argv
,doNotReap
);
Runs argv
in the background. If launching argv
fails, this will throw an error.
trySpawnCommandLine (command_line
);
Runs command_line
in the background. If launching command_line
fails, this will throw an error.
spawnCommandLineAsync (command_line
,function callback
,function errback
);
Runs command_line
in the background. If the process exits without error, a callback will be called, or an error callback will be called if one is provided.
killall (processName
);
Kills processName
. If no process with the given name is found, this will fail silently.
queryCollection (array collection
,object query
,boolean indexOnly
);
Returns (object|null): the matched object, or null if no object in the collection matches all conditions of the query.