30 #define G_LOG_DOMAIN "Helper" 41 #include <glib/gstdio.h> 42 #include <sys/types.h> 47 #include <pango/pango.h> 48 #include <pango/pango-fontmap.h> 49 #include <pango/pangocairo.h> 50 #include <librsvg/rsvg.h> 66 "on monitor with focused window",
67 "on monitor that has mouse pointer" 89 static gboolean
helper_eval_cb (
const GMatchInfo *info, GString *res, gpointer data )
93 match = g_match_info_fetch ( info, 0 );
94 if ( match != NULL ) {
96 gchar *r = g_hash_table_lookup ( (GHashTable *) data, match );
99 g_string_append ( res, r );
110 GError *error = NULL;
112 h = g_hash_table_new ( g_str_hash, g_str_equal );
118 va_start ( ap, length );
120 char * key = va_arg ( ap,
char * );
121 if ( key == (
char *) 0 ) {
124 char *value = va_arg ( ap,
char * );
125 if ( value == (
char *) 0 ) {
128 g_hash_table_insert ( h, key, value );
133 GRegex *reg = g_regex_new (
"{[-\\w]+}", 0, 0, NULL );
134 char *res = g_regex_replace_eval ( reg,
string, -1, 0, 0,
helper_eval_cb, h, NULL );
136 g_regex_unref ( reg );
138 g_hash_table_destroy ( h );
140 if ( g_shell_parse_argv ( res, length, output, &error ) ) {
147 char *msg = g_strdup_printf (
"Failed to parse: '%s'\nError: '%s'",
string, error->message );
151 g_error_free ( error );
158 for (
size_t i = 0; tokens && tokens[i]; i++ ) {
159 g_regex_unref ( (GRegex *) tokens[i]->regex );
160 g_free ( tokens[i] );
167 gchar *r = g_regex_escape_string ( input, -1 );
168 size_t str_l = strlen ( r );
169 for (
size_t i = 0; i < str_l; i++ ) {
170 if ( r[i] ==
'\\' ) {
171 if ( r[i + 1] ==
'*' ) {
174 else if ( r[i + 1] ==
'?' ) {
184 GString *str = g_string_new (
"" );
185 gchar *r = g_regex_escape_string ( input, -1 );
188 for ( iter = r; iter && *iter !=
'\0'; iter = g_utf8_next_char ( iter ) ) {
190 g_string_append ( str,
"(" );
193 g_string_append ( str,
".*(" );
195 if ( *iter ==
'\\' ) {
196 g_string_append_c ( str,
'\\' );
197 iter = g_utf8_next_char ( iter );
199 if ( ( *iter ) ==
'\0' ) {
203 g_string_append_unichar ( str, g_utf8_get_char ( iter ) );
204 g_string_append ( str,
")" );
208 char *retv = str->str;
209 g_string_free ( str, FALSE );
214 static inline GRegex *
R (
const char *s,
int case_sensitive )
216 return g_regex_new ( s, G_REGEX_OPTIMIZE | ( ( case_sensitive ) ? 0 : G_REGEX_CASELESS ), 0, NULL );
221 GRegex * retv = NULL;
232 retv =
R ( r, case_sensitive );
236 retv =
R ( input, case_sensitive );
237 if ( retv == NULL ) {
238 r = g_regex_escape_string ( input, -1 );
239 retv =
R ( r, case_sensitive );
245 retv =
R ( r, case_sensitive );
249 r = g_regex_escape_string ( input, -1 );
250 retv =
R ( r, case_sensitive );
259 if ( input == NULL ) {
262 size_t len = strlen ( input );
267 char *saveptr = NULL, *token;
279 char *str = g_strdup ( input );
283 const char *
const sep =
" ";
284 for ( token = strtok_r ( str, sep, &saveptr ); token != NULL; token = strtok_r ( NULL, sep, &saveptr ) ) {
285 retv = g_realloc ( retv,
sizeof (
rofi_int_matcher* ) * ( num_tokens + 2 ) );
286 retv[num_tokens] =
create_regex ( token, case_sensitive );
287 retv[num_tokens + 1] = NULL;
310 if ( val != NULL && i > 0 && i <
stored_argc - 1 ) {
319 const char **retv = NULL;
327 retv = g_malloc0 ( ( length + 1 ) *
sizeof (
char* ) );
342 if ( val != NULL && i > 0 && i < (
stored_argc - 1 ) ) {
352 if ( val != NULL && i > 0 && i < (
stored_argc - 1 ) ) {
361 const size_t len = strlen ( arg );
367 if ( len == 2 && arg[0] ==
'\\' ) {
371 case 'n':
return '\n';
373 case 'a':
return '\a';
375 case 'b':
return '\b';
377 case 't':
return '\t';
379 case 'v':
return '\v';
381 case 'f':
return '\f';
383 case 'r':
return '\r';
385 case '\\':
return '\\';
387 case '0':
return '\0';
392 if ( len > 2 && arg[0] ==
'\\' && arg[1] ==
'x' ) {
393 return (
char) strtol ( &arg[2], NULL, 16 );
395 g_warning (
"Failed to parse character string: \"%s\"", arg );
404 if ( val != NULL && i > 0 && i < (
stored_argc - 1 ) ) {
415 for (
int j = 0; tokens[j]; j++ ) {
416 GMatchInfo *gmi = NULL;
417 if ( tokens[j]->invert ) {
420 g_regex_match ( tokens[j]->regex, input, G_REGEX_MATCH_PARTIAL, &gmi );
421 while ( g_match_info_matches ( gmi ) ) {
422 int count = g_match_info_get_match_count ( gmi );
423 for (
int index = (
count > 1 ) ? 1 : 0; index <
count; index++ ) {
425 g_match_info_fetch_pos ( gmi, index, &start, &end );
427 PangoAttribute *pa = pango_attr_weight_new ( PANGO_WEIGHT_BOLD );
428 pa->start_index = start;
430 pango_attr_list_insert ( retv, pa );
433 PangoAttribute *pa = pango_attr_underline_new ( PANGO_UNDERLINE_SINGLE );
434 pa->start_index = start;
436 pango_attr_list_insert ( retv, pa );
439 PangoAttribute *pa = pango_attr_strikethrough_new ( TRUE );
440 pa->start_index = start;
442 pango_attr_list_insert ( retv, pa );
445 PangoAttribute *pa = pango_attr_variant_new ( PANGO_VARIANT_SMALL_CAPS );
446 pa->start_index = start;
448 pango_attr_list_insert ( retv, pa );
451 PangoAttribute *pa = pango_attr_style_new ( PANGO_STYLE_ITALIC );
452 pa->start_index = start;
454 pango_attr_list_insert ( retv, pa );
457 PangoAttribute *pa = pango_attr_foreground_new (
461 pa->start_index = start;
463 pango_attr_list_insert ( retv, pa );
466 g_match_info_next ( gmi, NULL );
468 g_match_info_free ( gmi );
479 for (
int j = 0; match && tokens[j]; j++ ) {
480 match = g_regex_match ( tokens[j]->regex, input, 0, NULL );
481 match ^= tokens[j]->invert;
494 GError *error = NULL;
495 g_spawn_async_with_pipes ( NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &fd, NULL, &error );
497 if ( error != NULL ) {
498 char *msg = g_strdup_printf (
"Failed to execute: '%s'\nError: '%s'", cmd, error->message );
502 g_error_free ( error );
515 int fd = g_open (
pidfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR );
517 g_warning (
"Failed to create pid file: '%s'.",
pidfile );
521 int flags = fcntl ( fd, F_GETFD, NULL );
523 if ( fcntl ( fd, F_SETFD,
flags, NULL ) < 0 ) {
524 g_warning (
"Failed to set CLOEXEC on pidfile." );
529 int retv = flock ( fd, LOCK_EX | LOCK_NB );
531 g_warning (
"Failed to set lock on pidfile: Rofi already running?" );
532 g_warning (
"Got error: %d %s", retv, g_strerror ( errno ) );
536 if ( ftruncate ( fd, (off_t) 0 ) == 0 ) {
539 int length = snprintf ( buffer, 64,
"%i", getpid () );
541 while ( l < length ) {
542 l += write ( fd, &buffer[l], length - l );
551 if ( close ( fd ) ) {
552 g_warning (
"Failed to close pidfile: '%s'", g_strerror ( errno ) );
559 const char *fam = pango_font_description_get_family ( pfd );
560 int size = pango_font_description_get_size ( pfd );
561 if ( fam == NULL || size == 0 ) {
562 g_debug (
"Pango failed to parse font: '%s'", font );
563 g_debug (
"Got family: <b>%s</b> at size: <b>%d</b>", fam ? fam :
"{unknown}", size );
577 int found_error = FALSE;
578 GString *msg = g_string_new (
579 "<big><b>The configuration failed to validate:</b></big>\n" );
592 g_string_append_printf ( msg,
"\t<b>config.sorting_method</b>=%s is not a valid sorting strategy.\nValid options are: normal or fzf.\n",
612 g_string_append_printf ( msg,
"\t<b>config.matching</b>=%s is not a valid matching strategy.\nValid options are: glob, regex, fuzzy or normal.\n",
619 g_string_append_printf ( msg,
"\t<b>config.element_height</b>=%d is invalid. An element needs to be atleast 1 line high.\n",
625 g_string_append_printf ( msg,
"\t<b>config.menu_columns</b>=%d is invalid. You need at least one visible column.\n",
631 g_string_append_printf ( msg,
"<b>config.menu_width</b>=0 is invalid. You cannot have a window with no width." );
636 g_string_append_printf ( msg,
"\t<b>config.location</b>=%d is invalid. Value should be between %d and %d.\n",
647 if ( name && name[0] ==
'-' ) {
648 int index = name[1] -
'0';
649 if ( index < 5 && index > 0 ) {
653 g_string_append_printf ( msg,
"\t<b>config.monitor</b>=%s Could not find monitor.\n", name );
659 PangoFontDescription *pfd = pango_font_description_from_string (
config.
menu_font );
660 const char *fam = pango_font_description_get_family ( pfd );
661 int size = pango_font_description_get_size ( pfd );
662 if ( fam == NULL || size == 0 ) {
663 g_string_append_printf ( msg,
"Pango failed to parse font: '%s'\n",
config.
menu_font );
664 g_string_append_printf ( msg,
"Got font family: <b>%s</b> at size <b>%d</b>\n", fam ? fam :
"{unknown}", size );
668 pango_font_description_free ( pfd );
678 g_string_append ( msg,
"Please update your configuration." );
683 g_string_free ( msg, TRUE );
689 char **str = g_strsplit ( input, G_DIR_SEPARATOR_S, -1 );
690 for (
unsigned int i = 0; str && str[i]; i++ ) {
692 if ( str[i][0] ==
'~' && str[i][1] ==
'\0' ) {
694 str[i] = g_strdup ( g_get_home_dir () );
697 else if ( str[i][0] ==
'~' ) {
698 struct passwd *p = getpwnam ( &( str[i][1] ) );
701 str[i] = g_strdup ( p->pw_dir );
706 if ( input[0] == G_DIR_SEPARATOR ) {
707 str[i] = g_strdup_printf (
"%s%s", G_DIR_SEPARATOR_S, s );
712 char *retv = g_build_filenamev ( str );
718 #define MIN3( a, b, c ) ( ( a ) < ( b ) ? ( ( a ) < ( c ) ? ( a ) : ( c ) ) : ( ( b ) < ( c ) ? ( b ) : ( c ) ) ) 720 unsigned int levenshtein (
const char *needle,
const glong needlelen,
const char *haystack,
const glong haystacklen )
722 if ( needlelen == G_MAXLONG ) {
726 unsigned int column[needlelen + 1];
727 for ( glong y = 0; y < needlelen; y++ ) {
732 column[needlelen] = needlelen;
733 for ( glong x = 1; x <= haystacklen; x++ ) {
734 const char *needles = needle;
736 gunichar haystackc = g_utf8_get_char ( haystack );
738 haystackc = g_unichar_tolower ( haystackc );
740 for ( glong y = 1, lastdiag = x - 1; y <= needlelen; y++ ) {
741 gunichar needlec = g_utf8_get_char ( needles );
743 needlec = g_unichar_tolower ( needlec );
745 unsigned int olddiag = column[y];
746 column[y] =
MIN3 ( column[y] + 1, column[y - 1] + 1, lastdiag + ( needlec == haystackc ? 0 : 1 ) );
748 needles = g_utf8_next_char ( needles );
750 haystack = g_utf8_next_char ( haystack );
752 return column[needlelen];
758 return g_convert_with_fallback ( input, length,
"UTF-8",
"latin1",
"\uFFFD", NULL, &slength, NULL );
763 if ( text == NULL ) {
766 gchar *ret = g_markup_escape_text ( text, -1 );
773 if ( data == NULL ) {
779 if ( g_utf8_validate ( data, length, &end ) ) {
780 return g_memdup ( data, length + 1 );
782 string = g_string_sized_new ( length + 16 );
786 g_string_append_len (
string, data, end - data );
788 g_string_append (
string,
"\uFFFD" );
789 length -= ( end - data ) + 1;
791 }
while ( !g_utf8_validate ( data, length, &end ) );
794 g_string_append_len (
string, data, length );
797 return g_string_free (
string, FALSE );
805 #define FUZZY_SCORER_MAX_LENGTH 256 807 #define MIN_SCORE ( INT_MIN / 2 ) 809 #define LEADING_GAP_SCORE -4 813 #define WORD_START_SCORE 50 815 #define NON_WORD_SCORE 40 817 #define CAMEL_SCORE ( WORD_START_SCORE + GAP_SCORE - 1 ) 819 #define CONSECUTIVE_SCORE ( WORD_START_SCORE + GAP_SCORE ) 821 #define PATTERN_NON_START_MULTIPLIER 1 823 #define PATTERN_START_MULTIPLIER 2 847 if ( g_unichar_islower ( c ) ) {
850 if ( g_unichar_isupper ( c ) ) {
853 if ( g_unichar_isdigit ( c ) ) {
916 gboolean pfirst = TRUE;
918 gboolean pstart = TRUE;
920 int *score = g_malloc_n ( slen,
sizeof (
int ) );
922 int *dp = g_malloc_n ( slen,
sizeof (
int ) );
925 int uleft = 0, ulefts = 0, left, lefts;
926 const gchar *pit = pattern, *sit;
928 for ( si = 0, sit = str; si < slen; si++, sit = g_utf8_next_char ( sit ) ) {
934 for ( pi = 0; pi < plen; pi++, pit = g_utf8_next_char ( pit ) ) {
935 gunichar pc = g_utf8_get_char ( pit ), sc;
936 if ( g_unichar_isspace ( pc ) ) {
941 for ( si = 0, sit = str; si < slen; si++, sit = g_utf8_next_char ( sit ) ) {
944 sc = g_utf8_get_char ( sit );
947 : g_unichar_tolower ( pc ) == g_unichar_tolower ( sc ) ) {
959 pfirst = pstart = FALSE;
962 for ( si = 0; si < slen; si++ ) {
963 lefts = MAX ( lefts +
GAP_SCORE, dp[si] );
983 char *na = g_utf8_normalize ( a, -1, G_NORMALIZE_ALL_COMPOSE );
984 char *nb = g_utf8_normalize ( b, -1, G_NORMALIZE_ALL_COMPOSE );
985 *g_utf8_offset_to_pointer ( na, n ) =
'\0';
986 *g_utf8_offset_to_pointer ( nb, n ) =
'\0';
987 int r = g_utf8_collate ( na, nb );
995 gboolean retv = TRUE;
996 GError *error = NULL;
998 GSpawnChildSetupFunc child_setup = NULL;
999 gpointer user_data = NULL;
1003 g_spawn_async ( wd, args, NULL, G_SPAWN_SEARCH_PATH, child_setup, user_data, NULL, &error );
1004 if ( error != NULL ) {
1005 char *msg = g_strdup_printf (
"Failed to execute: '%s%s'\nError: '%s'", error_precmd, error_cmd, error->message );
1009 g_error_free ( error );
1014 g_strfreev ( args );
1023 if ( run_in_term ) {
1030 if ( context != NULL ) {
1031 if ( context->
name == NULL ) {
1032 context->
name = args[0];
1034 if ( context->
binary == NULL ) {
1035 context->
binary = args[0];
1038 gsize l = strlen (
"Launching '' via rofi" ) + strlen ( cmd ) + 1;
1039 gchar *description = g_newa ( gchar, l );
1041 g_snprintf ( description, l,
"Launching '%s' via rofi", cmd );
1044 if ( context->
command == NULL ) {
1055 g_debug (
"Opening theme, testing: %s\n", filename );
1056 if ( g_file_test ( filename, G_FILE_TEST_EXISTS ) ) {
1059 g_free ( filename );
1061 if ( g_str_has_suffix ( file,
".rasi" ) ) {
1062 filename = g_strdup ( file );
1065 filename = g_strconcat ( file,
".rasi", NULL );
1068 const char *cpath = g_get_user_config_dir ();
1070 char *themep = g_build_filename ( cpath,
"rofi", filename, NULL );
1071 g_debug (
"Opening theme, testing: %s\n", themep );
1072 if ( g_file_test ( themep, G_FILE_TEST_EXISTS ) ) {
1073 g_free ( filename );
1078 const char * datadir = g_get_user_data_dir ();
1080 char *theme_path = g_build_filename ( datadir,
"rofi",
"themes", filename, NULL );
1081 g_debug (
"Opening theme, testing: %s\n", theme_path );
1083 if ( g_file_test ( theme_path, G_FILE_TEST_EXISTS ) ) {
1084 g_free ( filename );
1087 g_free ( theme_path );
1091 char *theme_path = g_build_filename ( THEME_DIR, filename, NULL );
1093 g_debug (
"Opening theme, testing: %s\n", theme_path );
1094 if ( g_file_test ( theme_path, G_FILE_TEST_EXISTS ) ) {
1095 g_free ( filename );
1098 g_free ( theme_path );
1105 GError *error = NULL;
1106 cairo_surface_t *surface = NULL;
1107 RsvgHandle * handle;
1109 handle = rsvg_handle_new_from_file ( file, &error );
1110 if ( G_LIKELY ( handle != NULL ) ) {
1111 RsvgDimensionData dimensions;
1113 rsvg_handle_set_dpi ( handle,
config.
dpi );
1115 rsvg_handle_get_dimensions ( handle, &dimensions );
1117 double scale = (double) height / dimensions.height;
1118 surface = cairo_image_surface_create ( CAIRO_FORMAT_ARGB32,
1119 (
double) dimensions.width * scale,
1120 (double) dimensions.height * scale );
1121 gboolean failed = cairo_surface_status ( surface ) != CAIRO_STATUS_SUCCESS;
1122 if ( G_LIKELY ( failed == FALSE ) ) {
1123 cairo_t *cr = cairo_create ( surface );
1124 cairo_scale ( cr, scale, scale );
1125 failed = rsvg_handle_render_cairo ( handle, cr ) == FALSE;
1126 cairo_destroy ( cr );
1129 rsvg_handle_close ( handle, &error );
1130 g_object_unref ( handle );
1133 if ( G_UNLIKELY ( failed ) ) {
1134 g_warning (
"Failed to render file: '%s'", file );
1135 cairo_surface_destroy ( surface );
1139 if ( G_UNLIKELY ( error != NULL ) ) {
1140 g_warning (
"Failed to render SVG file: '%s': %s", file, error->message );
1141 g_error_free ( error );
1150 const char *
const sep =
"-";
1151 for (
char *token = strsep ( &input, sep ); token != NULL; token = strsep ( &input, sep ) ) {
1153 item->
start = item->
stop = (
unsigned int) strtoul ( token, NULL, 10 );
1157 if ( token[0] ==
'\0' ) {
1158 item->
stop = 0xFFFFFFFF;
1161 item->
stop = (
unsigned int) strtoul ( token, NULL, 10 );
1169 if ( input == NULL ) {
1172 const char *
const sep =
",";
1173 for (
char *token = strtok_r ( input, sep, &endp ); token != NULL; token = strtok_r ( NULL, sep, &endp ) ) {
1175 *list = g_realloc ( ( *list ), ( ( *length ) + 1 ) *
sizeof (
struct rofi_range_pair ) );
1177 parse_pair ( token, &( ( *list )[*length] ) );
1202 for (
int i = 0; format && format[i]; i++ ) {
1203 if ( format[i] ==
'i' ) {
1204 fprintf ( stdout,
"%d", selected_line );
1206 else if ( format[i] ==
'd' ) {
1207 fprintf ( stdout,
"%d", ( selected_line + 1 ) );
1209 else if ( format[i] ==
's' ) {
1210 fputs (
string, stdout );
1212 else if ( format[i] ==
'q' ) {
1213 char *quote = g_shell_quote (
string );
1214 fputs ( quote, stdout );
1217 else if ( format[i] ==
'f' ) {
1219 fputs ( filter, stdout );
1222 else if ( format[i] ==
'F' ) {
1224 char *quote = g_shell_quote ( filter );
1225 fputs ( quote, stdout );
1230 fputc ( format[i], stdout );
1233 fputc (
'\n', stdout );
1242 int num_match = g_match_info_get_match_count(info);
1244 if ( num_match == 5 ) {
1245 match = g_match_info_fetch ( info, 4);
1246 if ( match != NULL ) {
1248 gchar *r = g_hash_table_lookup ( (GHashTable *) data, match );
1251 g_string_append ( res, r );
1258 else if ( num_match == 4 ) {
1259 match = g_match_info_fetch ( info, 2);
1260 if ( match != NULL ) {
1262 gchar *r = g_hash_table_lookup ( (GHashTable *) data, match );
1265 gchar *prefix = g_match_info_fetch (info, 1);
1266 g_string_append ( res, prefix );
1269 g_string_append ( res, r );
1271 gchar *post = g_match_info_fetch (info, 3);
1272 g_string_append ( res, post );
1286 GError *error = NULL;
1288 h = g_hash_table_new ( g_str_hash, g_str_equal );
1291 va_start ( ap,
string );
1293 char * key = va_arg ( ap,
char * );
1294 if ( key == (
char *) 0 ) {
1297 char *value = va_arg ( ap,
char * );
1298 g_hash_table_insert ( h, key, value );
1303 GRegex *reg = g_regex_new (
"\\[(.*)({[-\\w]+})(.*)\\]|({[\\w-]+})", 0, 0, NULL );
1304 char *res = g_regex_replace_eval ( reg,
string, -1, 0, 0,
helper_eval_cb2, h, NULL );
1306 g_regex_unref ( reg );
1308 g_hash_table_destroy ( h );
1311 char *msg = g_strdup_printf (
"Failed to parse: '%s'\nError: '%s'",
string, error->message );
1315 g_error_free ( error );
unsigned int levenshtein(const char *needle, const glong needlelen, const char *haystack, const glong haystacklen)
#define PATTERN_START_MULTIPLIER
static int rofi_scorer_get_score_for(enum CharClass prev, enum CharClass curr)
static enum CharClass rofi_scorer_get_character_class(gunichar c)
static gchar * glob_to_regex(const char *input)
int find_arg_char(const char *const key, char *val)
unsigned int case_sensitive
PangoAttrList * helper_token_match_get_pango_attr(RofiHighlightColorStyle th, rofi_int_matcher **tokens, const char *input, PangoAttrList *retv)
int utf8_strncmp(const char *a, const char *b, size_t n)
unsigned int menu_columns
cairo_surface_t * cairo_image_surface_create_from_svg(const gchar *file, int height)
void display_startup_notification(RofiHelperExecuteContext *context, GSpawnChildSetupFunc *child_setup, gpointer *user_data)
int config_sanity_check(void)
const char *const monitor_position_entries[]
static gboolean helper_eval_cb2(const GMatchInfo *info, GString *res, gpointer data)
int find_arg_uint(const char *const key, unsigned int *val)
char * helper_get_theme_path(const char *file)
gboolean helper_execute_command(const char *wd, const char *cmd, gboolean run_in_term, RofiHelperExecuteContext *context)
int find_arg_str(const char *const key, char **val)
int find_arg_int(const char *const key, int *val)
const char ** find_arg_strv(const char *const key)
gboolean helper_execute(const char *wd, char **args, const char *error_precmd, const char *error_cmd, RofiHelperExecuteContext *context)
rofi_int_matcher ** helper_tokenize(const char *input, int case_sensitive)
static GRegex * R(const char *s, int case_sensitive)
void remove_pid_file(int fd)
#define FUZZY_SCORER_MAX_LENGTH
int helper_token_match(rofi_int_matcher *const *tokens, const char *input)
static gchar * fuzzy_to_regex(const char *input)
char * rofi_latin_to_utf8_strdup(const char *input, gssize length)
static rofi_int_matcher * create_regex(const char *input, int case_sensitive)
int rofi_view_error_dialog(const char *msg, int markup)
void rofi_add_error_message(GString *str)
void cmd_set_arguments(int argc, char **argv)
MatchingMethod matching_method
char * rofi_expand_path(const char *input)
static char ** stored_argv
const gchar * description
SortingMethod sorting_method_enum
static gboolean helper_eval_cb(const GMatchInfo *info, GString *res, gpointer data)
int create_pid_file(const char *pidfile)
int execute_generator(const char *cmd)
#define CONSECUTIVE_SCORE
int helper_parse_setup(char *string, char ***output, int *length,...)
void parse_ranges(char *input, rofi_range_pair **list, unsigned int *length)
int monitor_active(workarea *mon)
static void parse_pair(char *input, rofi_range_pair *item)
char * rofi_force_utf8(const gchar *data, ssize_t length)
gchar * rofi_escape_markup(gchar *text)
void helper_tokenize_free(rofi_int_matcher **tokens)
char matching_negate_char
void rofi_output_formatted_line(const char *format, const char *string, int selected_line, const char *filter)
int find_arg(const char *const key)
char * helper_string_replace_if_exists(char *string,...)
char helper_parse_char(const char *arg)
#define PATTERN_NON_START_MULTIPLIER
#define LEADING_GAP_SCORE
int rofi_scorer_fuzzy_evaluate(const char *pattern, glong plen, const char *str, glong slen)
gboolean helper_validate_font(PangoFontDescription *pfd, const char *font)