Util

Util — File providing certain utility functions

Functions

Description

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.

Functions

findUrls ()


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.

Parameters

str

string to find URLs in

 

Returns

the list of match objects, as described above


spawn ()


spawn (argv);

Runs argv in the background, handling any errors that occur when trying to start the program.

Parameters

argv

an argv array

 

spawnCommandLine ()


spawnCommandLine (command_line);

Runs command_line in the background, handling any errors that occur when trying to parse or start the program.

Parameters

command_line

a command line

 

trySpawn ()


trySpawn (argv);

Runs argv in the background. If launching argv fails, this will throw an error.

Parameters

argv

an argv array

 

trySpawnCommandLine ()


trySpawnCommandLine (command_line);

Runs command_line in the background. If launching command_line fails, this will throw an error.

Parameters

command_line

a command line

 

killall ()


killall (processName);

Kills processName. If no process with the given name is found, this will fail silently.

Parameters

processName

a process name

 

latinise ()

string
latinise (string   string);

Parameters

string

a string

 

Returns

string, replaced accented chars