Module helper

Module helper 

Source
Expand description

Helper utilities.

This corresponds to helper.h.

Structs§

RofiHelperExecuteContext
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 ThemeWidget if 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 context are null, they will be filled.
execute_generator
Execute cmd using config.run_command and 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 key to character. This supports character escaping.
find_arg_int
Parse command line argument key to int.
find_arg_str
Parse command line argument key to string.
find_arg_strv
Parse all command line options key to string vector.
find_arg_uint
Parse command line argument key to 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 pattern to str. It applies when pattern is a subsequence of str.
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 Property if 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_COMPOSE forms of the two strings.