Expand description
Helper utilities.
This corresponds to helper.h.
Structs§
- Rofi
Helper Execute Context - The startup notification context of the application to launch.
Functions§
- cairo_
image_ ⚠surface_ create_ from_ svg - Get a cairo surface from an SVG path.
- cmd_
set_ ⚠arguments - Set the application arguments.
- config_
find_ ⚠widget - Find the configuration element.
If not exact, the closest specified element is returned.
Returns the
ThemeWidgetif found, otherwise null. - config_
sanity_ ⚠check - Do some input validation, especially the first few could break things. It is good to catch them beforehand.
- create_
pid_ ⚠file - Returns file descriptor (or -1 when failed).
- execute⚠
- Executes the comand.
- execute_
command ⚠ - Executes the comand.
If needed memebrs of
contextare null, they will be filled. - execute_
generator ⚠ - Execute cmd using
config.run_commandand outputs the result (stdout) to the opened file descriptor. - expand_
path ⚠ - Expand path, both
~and~<user>. - find_
arg ⚠ - Check if key is passed as argument.
- find_
arg_ ⚠char - Parse command line argument
keyto character. This supports character escaping. - find_
arg_ ⚠int - Parse command line argument
keyto int. - find_
arg_ ⚠str - Parse command line argument
keyto string. - find_
arg_ ⚠strv - Parse all command line options
keyto string vector. - find_
arg_ ⚠uint - Parse command line argument
keyto unsigned int. - force_
utf8 ⚠ - Convert string to valid UTF-8, replacing invalid parts with replacement character.
- get_
theme_ ⚠path - Returns path to theme or copy of filename if not found.
- latin_
to_ ⚠utf8_ strdup - Converts latin to UTF-8.
- levenshtein⚠
- UTF-8 aware levenshtein distance calculation.
- output_
formatted_ ⚠line - This functions outputs the formatted string to stdout, appends a newline (
\n) character and calls flush on the file descriptor. - parse_
char ⚠ - Parses a string into a character.
- parse_
ranges ⚠ - Parse ranges.
- parse_
setup ⚠ - Parses a string into arguments, replacing keys with values.
- remove_
pid_ ⚠file - Remove pid file.
- scorer_
fuzzy_ ⚠evaluate - Run Rofi’s global sequence alignment algorithm to find the maximum accumulated score by
aligning
patterntostr. It applies whenpatternis a subsequence ofstr. - string_
replace_ ⚠if_ exists - Items {key} are replaced by the value if
{key}is passed as key/value pair, otherwise removed from string. If the {key} is in between [] all the text between [] are removed if {key} is not found. Otherwise key is replaced and & removed. - theme_
find_ ⚠property - Find the property on the widget.
If not exact, the parents are searched recursively until match is found.
Returns the
Propertyif found, otherwise null. - token_
match ⚠ - Tokenized match, match tokens to line input.
- tokenize⚠
- Tokenize the string on spaces.
- tokenize_
free ⚠ - Frees the array of matching objects.
- utf8_
strncmp ⚠ - Compares the
G_NORMALIZE_ALL_COMPOSEforms of the two strings.