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>
65 "on monitor with focused window",
66 "on monitor that has mouse pointer"
85 h = g_hash_table_new ( g_str_hash, g_str_equal );
91 va_start ( ap, length );
93 char * key = va_arg ( ap,
char * );
94 if ( key == (
char *) 0 ) {
97 char *value = va_arg ( ap,
char * );
98 if ( value == (
char *) 0 ) {
101 g_hash_table_insert ( h, key, value );
107 g_hash_table_destroy ( h );
109 if ( g_shell_parse_argv ( res, length, output, &error ) ) {
116 char *msg = g_strdup_printf (
"Failed to parse: '%s'\nError: '%s'",
string, error->message );
120 g_error_free ( error );
127 for (
size_t i = 0; tokens && tokens[i]; i++ ) {
128 g_regex_unref ( (GRegex *) tokens[i]->regex );
129 g_free ( tokens[i] );
136 gchar *r = g_regex_escape_string ( input, -1 );
137 size_t str_l = strlen ( r );
138 for (
size_t i = 0; i < str_l; i++ ) {
139 if ( r[i] ==
'\\' ) {
140 if ( r[i + 1] ==
'*' ) {
143 else if ( r[i + 1] ==
'?' ) {
153 GString *str = g_string_new (
"" );
154 gchar *r = g_regex_escape_string ( input, -1 );
157 for ( iter = r; iter && *iter !=
'\0'; iter = g_utf8_next_char ( iter ) ) {
159 g_string_append ( str,
"(" );
162 g_string_append ( str,
".*?(" );
164 if ( *iter ==
'\\' ) {
165 g_string_append_c ( str,
'\\' );
166 iter = g_utf8_next_char ( iter );
168 if ( ( *iter ) ==
'\0' ) {
172 g_string_append_unichar ( str, g_utf8_get_char ( iter ) );
173 g_string_append ( str,
")" );
177 char *retv = str->str;
178 g_string_free ( str, FALSE );
184 gunichar buf2[G_UNICHAR_MAX_DECOMPOSITION_LENGTH] = { 0, };
185 char buf[6] = { 0, };
187 char * str = g_malloc0 ( ( g_utf8_strlen ( s, 0 ) * 6 + 2 ) );
189 for (
const char *iter = s; iter && *iter; iter = g_utf8_next_char ( iter ) ) {
190 gunichar uc = g_utf8_get_char ( iter );
192 gsize dl = g_unichar_fully_decompose ( uc, FALSE, buf2, G_UNICHAR_MAX_DECOMPOSITION_LENGTH );
194 l = g_unichar_to_utf8 ( buf2[0], buf );
197 l = g_unichar_to_utf8 ( uc, buf );
199 memcpy ( striter, buf, l );
207 static inline GRegex *
R (
const char *s,
int case_sensitive )
212 GRegex *r = g_regex_new ( str, G_REGEX_OPTIMIZE | ( ( case_sensitive ) ? 0 : G_REGEX_CASELESS ), 0, NULL );
218 return g_regex_new ( s, G_REGEX_OPTIMIZE | ( ( case_sensitive ) ? 0 : G_REGEX_CASELESS ), 0, NULL );
224 GRegex * retv = NULL;
235 retv =
R ( r, case_sensitive );
239 retv =
R ( input, case_sensitive );
240 if ( retv == NULL ) {
241 r = g_regex_escape_string ( input, -1 );
242 retv =
R ( r, case_sensitive );
248 retv =
R ( r, case_sensitive );
252 r = g_regex_escape_string ( input, -1 );
253 retv =
R ( r, case_sensitive );
262 if ( input == NULL ) {
265 size_t len = strlen ( input );
270 char *saveptr = NULL, *token;
282 char *str = g_strdup ( input );
286 const char *
const sep =
" ";
287 for ( token = strtok_r ( str, sep, &saveptr ); token != NULL; token = strtok_r ( NULL, sep, &saveptr ) ) {
288 retv = g_realloc ( retv,
sizeof (
rofi_int_matcher* ) * ( num_tokens + 2 ) );
289 retv[num_tokens] =
create_regex ( token, case_sensitive );
290 retv[num_tokens + 1] = NULL;
313 if ( val != NULL && i > 0 && i <
stored_argc - 1 ) {
322 const char **retv = NULL;
330 retv = g_malloc0 ( ( length + 1 ) *
sizeof (
char* ) );
345 if ( val != NULL && i > 0 && i < (
stored_argc - 1 ) ) {
355 if ( val != NULL && i > 0 && i < (
stored_argc - 1 ) ) {
364 const size_t len = strlen ( arg );
370 if ( len == 2 && arg[0] ==
'\\' ) {
374 case 'n':
return '\n';
376 case 'a':
return '\a';
378 case 'b':
return '\b';
380 case 't':
return '\t';
382 case 'v':
return '\v';
384 case 'f':
return '\f';
386 case 'r':
return '\r';
388 case '\\':
return '\\';
390 case '0':
return '\0';
395 if ( len > 2 && arg[0] ==
'\\' && arg[1] ==
'x' ) {
396 return (
char) strtol ( &arg[2], NULL, 16 );
398 g_warning (
"Failed to parse character string: \"%s\"", arg );
407 if ( val != NULL && i > 0 && i < (
stored_argc - 1 ) ) {
422 for (
int j = 0; tokens[j]; j++ ) {
423 GMatchInfo *gmi = NULL;
424 if ( tokens[j]->invert ) {
427 g_regex_match ( tokens[j]->regex, input, G_REGEX_MATCH_PARTIAL, &gmi );
428 while ( g_match_info_matches ( gmi ) ) {
429 int count = g_match_info_get_match_count ( gmi );
430 for (
int index = (
count > 1 ) ? 1 : 0; index <
count; index++ ) {
432 g_match_info_fetch_pos ( gmi, index, &start, &end );
434 PangoAttribute *pa = pango_attr_weight_new ( PANGO_WEIGHT_BOLD );
435 pa->start_index = start;
437 pango_attr_list_insert ( retv, pa );
440 PangoAttribute *pa = pango_attr_underline_new ( PANGO_UNDERLINE_SINGLE );
441 pa->start_index = start;
443 pango_attr_list_insert ( retv, pa );
446 PangoAttribute *pa = pango_attr_strikethrough_new ( TRUE );
447 pa->start_index = start;
449 pango_attr_list_insert ( retv, pa );
452 PangoAttribute *pa = pango_attr_variant_new ( PANGO_VARIANT_SMALL_CAPS );
453 pa->start_index = start;
455 pango_attr_list_insert ( retv, pa );
458 PangoAttribute *pa = pango_attr_style_new ( PANGO_STYLE_ITALIC );
459 pa->start_index = start;
461 pango_attr_list_insert ( retv, pa );
464 PangoAttribute *pa = pango_attr_foreground_new (
468 pa->start_index = start;
470 pango_attr_list_insert ( retv, pa );
473 pa = pango_attr_foreground_alpha_new ( th.
color.
alpha * 65535 );
474 pa->start_index = start;
476 pango_attr_list_insert ( retv, pa );
480 g_match_info_next ( gmi, NULL );
482 g_match_info_free ( gmi );
495 for (
int j = 0; match && tokens[j]; j++ ) {
496 match = g_regex_match ( tokens[j]->regex, r, 0, NULL );
497 match ^= tokens[j]->invert;
502 for (
int j = 0; match && tokens[j]; j++ ) {
503 match = g_regex_match ( tokens[j]->regex, input, 0, NULL );
504 match ^= tokens[j]->invert;
518 GError *error = NULL;
519 g_spawn_async_with_pipes ( NULL, args, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &fd, NULL, &error );
521 if ( error != NULL ) {
522 char *msg = g_strdup_printf (
"Failed to execute: '%s'\nError: '%s'", cmd, error->message );
526 g_error_free ( error );
539 int fd = g_open (
pidfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR );
541 g_warning (
"Failed to create pid file: '%s'.",
pidfile );
545 int flags = fcntl ( fd, F_GETFD, NULL );
547 if ( fcntl ( fd, F_SETFD,
flags, NULL ) < 0 ) {
548 g_warning (
"Failed to set CLOEXEC on pidfile." );
553 int retv = flock ( fd, LOCK_EX | LOCK_NB );
555 g_warning (
"Failed to set lock on pidfile: Rofi already running?" );
556 g_warning (
"Got error: %d %s", retv, g_strerror ( errno ) );
560 if ( ftruncate ( fd, (off_t) 0 ) == 0 ) {
563 int length = snprintf ( buffer, 64,
"%i", getpid () );
565 while ( l < length ) {
566 l += write ( fd, &buffer[l], length - l );
575 if ( close ( fd ) ) {
576 g_warning (
"Failed to close pidfile: '%s'", g_strerror ( errno ) );
583 const char *fam = pango_font_description_get_family ( pfd );
584 int size = pango_font_description_get_size ( pfd );
585 if ( fam == NULL || size == 0 ) {
586 g_debug (
"Pango failed to parse font: '%s'", font );
587 g_debug (
"Got family: <b>%s</b> at size: <b>%d</b>", fam ? fam :
"{unknown}", size );
601 int found_error = FALSE;
602 GString *msg = g_string_new (
603 "<big><b>The configuration failed to validate:</b></big>\n" );
616 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",
636 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",
643 g_string_append_printf ( msg,
"\t<b>config.element_height</b>=%d is invalid. An element needs to be atleast 1 line high.\n",
649 g_string_append_printf ( msg,
"\t<b>config.menu_columns</b>=%d is invalid. You need at least one visible column.\n",
655 g_string_append_printf ( msg,
"<b>config.menu_width</b>=0 is invalid. You cannot have a window with no width." );
660 g_string_append_printf ( msg,
"\t<b>config.location</b>=%d is invalid. Value should be between %d and %d.\n",
671 if ( name && name[0] ==
'-' ) {
672 int index = name[1] -
'0';
673 if ( index < 5 && index > 0 ) {
677 g_string_append_printf ( msg,
"\t<b>config.monitor</b>=%s Could not find monitor.\n", name );
683 PangoFontDescription *pfd = pango_font_description_from_string (
config.
menu_font );
684 const char *fam = pango_font_description_get_family ( pfd );
685 int size = pango_font_description_get_size ( pfd );
686 if ( fam == NULL || size == 0 ) {
687 g_string_append_printf ( msg,
"Pango failed to parse font: '%s'\n",
config.
menu_font );
688 g_string_append_printf ( msg,
"Got font family: <b>%s</b> at size <b>%d</b>\n", fam ? fam :
"{unknown}", size );
692 pango_font_description_free ( pfd );
702 g_string_append ( msg,
"Please update your configuration." );
707 g_string_free ( msg, TRUE );
713 char **str = g_strsplit ( input, G_DIR_SEPARATOR_S, -1 );
714 for (
unsigned int i = 0; str && str[i]; i++ ) {
716 if ( str[i][0] ==
'~' && str[i][1] ==
'\0' ) {
718 str[i] = g_strdup ( g_get_home_dir () );
721 else if ( str[i][0] ==
'~' ) {
722 struct passwd *p = getpwnam ( &( str[i][1] ) );
725 str[i] = g_strdup ( p->pw_dir );
730 if ( input[0] == G_DIR_SEPARATOR ) {
731 str[i] = g_strdup_printf (
"%s%s", G_DIR_SEPARATOR_S, s );
736 char *retv = g_build_filenamev ( str );
742 #define MIN3( a, b, c ) ( ( a ) < ( b ) ? ( ( a ) < ( c ) ? ( a ) : ( c ) ) : ( ( b ) < ( c ) ? ( b ) : ( c ) ) )
744 unsigned int levenshtein (
const char *needle,
const glong needlelen,
const char *haystack,
const glong haystacklen )
746 if ( needlelen == G_MAXLONG ) {
750 unsigned int column[needlelen + 1];
751 for ( glong y = 0; y < needlelen; y++ ) {
756 column[needlelen] = needlelen;
757 for ( glong x = 1; x <= haystacklen; x++ ) {
758 const char *needles = needle;
760 gunichar haystackc = g_utf8_get_char ( haystack );
762 haystackc = g_unichar_tolower ( haystackc );
764 for ( glong y = 1, lastdiag = x - 1; y <= needlelen; y++ ) {
765 gunichar needlec = g_utf8_get_char ( needles );
767 needlec = g_unichar_tolower ( needlec );
769 unsigned int olddiag = column[y];
770 column[y] =
MIN3 ( column[y] + 1, column[y - 1] + 1, lastdiag + ( needlec == haystackc ? 0 : 1 ) );
772 needles = g_utf8_next_char ( needles );
774 haystack = g_utf8_next_char ( haystack );
776 return column[needlelen];
782 return g_convert_with_fallback ( input, length,
"UTF-8",
"latin1",
"\uFFFD", NULL, &slength, NULL );
787 if ( text == NULL ) {
790 gchar *ret = g_markup_escape_text ( text, -1 );
797 if ( data == NULL ) {
803 if ( g_utf8_validate ( data, length, &end ) ) {
804 return g_memdup ( data, length + 1 );
806 string = g_string_sized_new ( length + 16 );
810 g_string_append_len (
string, data, end - data );
812 g_string_append (
string,
"\uFFFD" );
813 length -= ( end - data ) + 1;
815 }
while ( !g_utf8_validate ( data, length, &end ) );
818 g_string_append_len (
string, data, length );
821 return g_string_free (
string, FALSE );
829 #define FUZZY_SCORER_MAX_LENGTH 256
831 #define MIN_SCORE ( INT_MIN / 2 )
833 #define LEADING_GAP_SCORE -4
837 #define WORD_START_SCORE 50
839 #define NON_WORD_SCORE 40
841 #define CAMEL_SCORE ( WORD_START_SCORE + GAP_SCORE - 1 )
843 #define CONSECUTIVE_SCORE ( WORD_START_SCORE + GAP_SCORE )
845 #define PATTERN_NON_START_MULTIPLIER 1
847 #define PATTERN_START_MULTIPLIER 2
871 if ( g_unichar_islower ( c ) ) {
874 if ( g_unichar_isupper ( c ) ) {
877 if ( g_unichar_isdigit ( c ) ) {
940 gboolean pfirst = TRUE;
942 gboolean pstart = TRUE;
944 int *score = g_malloc_n ( slen,
sizeof (
int ) );
946 int *dp = g_malloc_n ( slen,
sizeof (
int ) );
949 int uleft = 0, ulefts = 0, left, lefts;
950 const gchar *pit = pattern, *sit;
952 for ( si = 0, sit = str; si < slen; si++, sit = g_utf8_next_char ( sit ) ) {
958 for ( pi = 0; pi < plen; pi++, pit = g_utf8_next_char ( pit ) ) {
959 gunichar pc = g_utf8_get_char ( pit ), sc;
960 if ( g_unichar_isspace ( pc ) ) {
965 for ( si = 0, sit = str; si < slen; si++, sit = g_utf8_next_char ( sit ) ) {
968 sc = g_utf8_get_char ( sit );
971 : g_unichar_tolower ( pc ) == g_unichar_tolower ( sc ) ) {
983 pfirst = pstart = FALSE;
986 for ( si = 0; si < slen; si++ ) {
987 lefts = MAX ( lefts +
GAP_SCORE, dp[si] );
1007 char *na = g_utf8_normalize ( a, -1, G_NORMALIZE_ALL_COMPOSE );
1008 char *nb = g_utf8_normalize ( b, -1, G_NORMALIZE_ALL_COMPOSE );
1009 *g_utf8_offset_to_pointer ( na, n ) =
'\0';
1010 *g_utf8_offset_to_pointer ( nb, n ) =
'\0';
1011 int r = g_utf8_collate ( na, nb );
1019 gboolean retv = TRUE;
1020 GError *error = NULL;
1022 GSpawnChildSetupFunc child_setup = NULL;
1023 gpointer user_data = NULL;
1027 g_spawn_async ( wd, args, NULL, G_SPAWN_SEARCH_PATH, child_setup, user_data, NULL, &error );
1028 if ( error != NULL ) {
1029 char *msg = g_strdup_printf (
"Failed to execute: '%s%s'\nError: '%s'", error_precmd, error_cmd, error->message );
1033 g_error_free ( error );
1038 g_strfreev ( args );
1047 if ( run_in_term ) {
1054 if ( args == NULL ) {
1058 if ( context != NULL ) {
1059 if ( context->
name == NULL ) {
1060 context->
name = args[0];
1062 if ( context->
binary == NULL ) {
1063 context->
binary = args[0];
1066 gsize l = strlen (
"Launching '' via rofi" ) + strlen ( cmd ) + 1;
1067 gchar *description = g_newa ( gchar, l );
1069 g_snprintf ( description, l,
"Launching '%s' via rofi", cmd );
1072 if ( context->
command == NULL ) {
1083 g_debug (
"Opening theme, testing: %s\n", filename );
1084 if ( g_file_test ( filename, G_FILE_TEST_EXISTS ) ) {
1087 g_free ( filename );
1089 if ( g_str_has_suffix ( file,
".rasi" ) ) {
1090 filename = g_strdup ( file );
1093 filename = g_strconcat ( file,
".rasi", NULL );
1096 const char *cpath = g_get_user_config_dir ();
1098 char *themep = g_build_filename ( cpath,
"rofi",
"themes", filename, NULL );
1099 g_debug (
"Opening theme, testing: %s\n", themep );
1100 if ( themep && g_file_test ( themep, G_FILE_TEST_EXISTS ) ) {
1101 g_free ( filename );
1108 char *themep = g_build_filename ( cpath,
"rofi", filename, NULL );
1109 g_debug (
"Opening theme, testing: %s\n", themep );
1110 if ( g_file_test ( themep, G_FILE_TEST_EXISTS ) ) {
1111 g_free ( filename );
1116 const char * datadir = g_get_user_data_dir ();
1118 char *theme_path = g_build_filename ( datadir,
"rofi",
"themes", filename, NULL );
1119 g_debug (
"Opening theme, testing: %s\n", theme_path );
1121 if ( g_file_test ( theme_path, G_FILE_TEST_EXISTS ) ) {
1122 g_free ( filename );
1125 g_free ( theme_path );
1129 char *theme_path = g_build_filename ( THEME_DIR, filename, NULL );
1131 g_debug (
"Opening theme, testing: %s\n", theme_path );
1132 if ( g_file_test ( theme_path, G_FILE_TEST_EXISTS ) ) {
1133 g_free ( filename );
1136 g_free ( theme_path );
1144 while ( input != NULL && isblank ( *input ) ) {
1148 const char *sep[] = {
"-",
":" };
1149 int pythonic = ( strchr ( input,
':' ) || input[0] ==
'-' ) ? 1 : 0;
1152 for (
char *token = strsep ( &input, sep[pythonic] ); token != NULL; token = strsep ( &input, sep[pythonic] ) ) {
1154 item->
start = item->
stop = (int) strtol ( token, NULL, 10 );
1159 if ( token[0] ==
'\0' ) {
1164 item->
stop = (int) strtol ( token, NULL, 10 );
1173 if ( input == NULL ) {
1176 const char *
const sep =
",";
1177 for (
char *token = strtok_r ( input, sep, &endp ); token != NULL; token = strtok_r ( NULL, sep, &endp ) ) {
1179 *list = g_realloc ( ( *list ), ( ( *length ) + 1 ) *
sizeof (
struct rofi_range_pair ) );
1181 parse_pair ( token, &( ( *list )[*length] ) );
1206 for (
int i = 0; format && format[i]; i++ ) {
1207 if ( format[i] ==
'i' ) {
1208 fprintf ( stdout,
"%d", selected_line );
1210 else if ( format[i] ==
'd' ) {
1211 fprintf ( stdout,
"%d", ( selected_line + 1 ) );
1213 else if ( format[i] ==
's' ) {
1214 fputs (
string, stdout );
1216 else if ( format[i] ==
'p' ) {
1218 pango_parse_markup (
string, -1, 0, NULL, &esc, NULL, NULL );
1220 fputs ( esc, stdout );
1224 fputs (
"invalid string", stdout );
1227 else if ( format[i] ==
'q' ) {
1228 char *quote = g_shell_quote (
string );
1229 fputs ( quote, stdout );
1232 else if ( format[i] ==
'f' ) {
1234 fputs ( filter, stdout );
1237 else if ( format[i] ==
'F' ) {
1239 char *quote = g_shell_quote ( filter );
1240 fputs ( quote, stdout );
1245 fputc ( format[i], stdout );
1248 fputc (
'\n', stdout );
1256 int num_match = g_match_info_get_match_count ( info );
1258 if ( num_match == 5 ) {
1259 match = g_match_info_fetch ( info, 4 );
1260 if ( match != NULL ) {
1262 gchar *r = g_hash_table_lookup ( (GHashTable *) data, match );
1265 g_string_append ( res, r );
1272 else if ( num_match == 4 ) {
1273 match = g_match_info_fetch ( info, 2 );
1274 if ( match != NULL ) {
1276 gchar *r = g_hash_table_lookup ( (GHashTable *) data, match );
1279 gchar *prefix = g_match_info_fetch ( info, 1 );
1280 g_string_append ( res, prefix );
1283 g_string_append ( res, r );
1285 gchar *post = g_match_info_fetch ( info, 3 );
1286 g_string_append ( res, post );
1301 h = g_hash_table_new ( g_str_hash, g_str_equal );
1303 va_start ( ap,
string );
1306 char * key = va_arg ( ap,
char * );
1307 if ( key == (
char *) 0 ) {
1310 char *value = va_arg ( ap,
char * );
1311 g_hash_table_insert ( h, key, value );
1316 g_hash_table_destroy ( h );
1334 GError *error = NULL;
1338 GRegex *reg = g_regex_new (
"\\[(.*)({[-\\w]+})(.*)\\]|({[\\w-]+})", 0, 0, &error );
1339 if ( error == NULL ) {
1340 res = g_regex_replace_eval ( reg,
string, -1, 0, 0,
helper_eval_cb2, h, &error );
1343 g_regex_unref ( reg );
1345 if ( error != NULL ) {
1346 char *msg = g_strdup_printf (
"Failed to parse: '%s'\nError: '%s'",
string, error->message );
1350 g_error_free ( error );
PangoAttrList * helper_token_match_get_pango_attr(RofiHighlightColorStyle th, rofi_int_matcher **tokens, const char *input, PangoAttrList *retv)
gboolean helper_validate_font(PangoFontDescription *pfd, const char *font)
void parse_ranges(char *input, rofi_range_pair **list, unsigned int *length)
void cmd_set_arguments(int argc, char **argv)
int find_arg_char(const char *const key, char *val)
gboolean helper_execute_command(const char *wd, const char *cmd, gboolean run_in_term, RofiHelperExecuteContext *context)
void helper_tokenize_free(rofi_int_matcher **tokens)
char helper_parse_char(const char *arg)
void rofi_output_formatted_line(const char *format, const char *string, int selected_line, const char *filter)
gboolean helper_execute(const char *wd, char **args, const char *error_precmd, const char *error_cmd, RofiHelperExecuteContext *context)
unsigned int levenshtein(const char *needle, const glong needlelen, const char *haystack, const glong haystacklen)
char * rofi_latin_to_utf8_strdup(const char *input, gssize length)
int create_pid_file(const char *pidfile)
const char ** find_arg_strv(const char *const key)
int helper_parse_setup(char *string, char ***output, int *length,...)
int execute_generator(const char *cmd)
gchar * rofi_escape_markup(gchar *text)
int find_arg_int(const char *const key, int *val)
void remove_pid_file(int fd)
int rofi_scorer_fuzzy_evaluate(const char *pattern, glong plen, const char *str, glong slen)
char * rofi_expand_path(const char *input)
int find_arg_str(const char *const key, char **val)
rofi_int_matcher ** helper_tokenize(const char *input, int case_sensitive)
int find_arg_uint(const char *const key, unsigned int *val)
char * helper_string_replace_if_exists(char *string,...)
int find_arg(const char *const key)
int helper_token_match(rofi_int_matcher *const *tokens, const char *input)
int config_sanity_check(void)
char * rofi_force_utf8(const gchar *data, ssize_t length)
void rofi_add_error_message(GString *str)
int rofi_view_error_dialog(const char *msg, int markup)
#define CONSECUTIVE_SCORE
char * helper_get_theme_path(const char *file)
#define LEADING_GAP_SCORE
static char ** stored_argv
const char *const monitor_position_entries[]
static char * utf8_helper_simplify_string(const char *s)
static enum CharClass rofi_scorer_get_character_class(gunichar c)
int utf8_strncmp(const char *a, const char *b, size_t n)
static gchar * glob_to_regex(const char *input)
#define PATTERN_NON_START_MULTIPLIER
char * helper_string_replace_if_exists_v(char *string, GHashTable *h)
#define FUZZY_SCORER_MAX_LENGTH
static gboolean helper_eval_cb2(const GMatchInfo *info, GString *res, gpointer data)
#define PATTERN_START_MULTIPLIER
static rofi_int_matcher * create_regex(const char *input, int case_sensitive)
static GRegex * R(const char *s, int case_sensitive)
static void parse_pair(char *input, rofi_range_pair *item)
static gchar * fuzzy_to_regex(const char *input)
static int rofi_scorer_get_score_for(enum CharClass prev, enum CharClass curr)
const gchar * description
MatchingMethod matching_method
unsigned int case_sensitive
char matching_negate_char
SortingMethod sorting_method_enum
unsigned int menu_columns
int monitor_active(workarea *mon)
void display_startup_notification(RofiHelperExecuteContext *context, GSpawnChildSetupFunc *child_setup, gpointer *user_data)