rofi 1.7.8
script.c
Go to the documentation of this file.
1/*
2 * rofi
3 *
4 * MIT/X11 License
5 * Copyright © 2013-2023 Qball Cow <qball@gmpclient.org>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 */
27
29#define G_LOG_DOMAIN "Modes.Script"
30
31#include "modes/script.h"
32#include "helper.h"
33#include "rofi.h"
34#include <assert.h>
35#include <ctype.h>
36#include <errno.h>
37#include <stdio.h>
38#include <stdlib.h>
39#include <string.h>
40#include <strings.h>
41#include <unistd.h>
42
43#include "widgets/textbox.h"
44
45#include "mode-private.h"
46
47#include "rofi-icon-fetcher.h"
48
50
51typedef struct {
53 unsigned int id;
57 unsigned int cmd_list_length;
58
61 unsigned int num_urgent_list;
64 unsigned int num_active_list;
66 char *message;
67 char *prompt;
68 char *data;
69 gboolean do_markup;
72 char delim;
74 gboolean no_custom;
76 gboolean keep_filter;
77
78 gboolean use_hot_keys;
80
84void dmenuscript_parse_entry_extras(G_GNUC_UNUSED Mode *sw,
85 DmenuScriptEntry *entry, char *buffer,
86 G_GNUC_UNUSED size_t length) {
87 gchar **extras = g_strsplit(buffer, "\x1f", -1);
88 gchar **extra = extras;
89 for (; *extra != NULL && *(extra + 1) != NULL; extra += 2) {
90 gchar *key = *extra;
91 gchar *value = *(extra + 1);
92 // Mark NULL
93 *(extra) = NULL;
94 *(extra + 1) = NULL;
95 if (strcasecmp(key, "icon") == 0) {
96 entry->icon_name = value;
97 } else if (strcasecmp(key, "display") == 0) {
98 entry->display = value;
99 } else if (strcasecmp(key, "meta") == 0) {
100 entry->meta = value;
101 } else if (strcasecmp(key, "info") == 0) {
102 entry->info = value;
103 } else if (strcasecmp(key, "nonselectable") == 0) {
104 entry->nonselectable = g_ascii_strcasecmp(value, "true") == 0;
105 g_free(value);
106 } else if (strcasecmp(key, "permanent") == 0) {
107 entry->permanent = g_ascii_strcasecmp(value, "true") == 0;
108 g_free(value);
109 } else if (strcasecmp(key, "urgent") == 0) {
110 entry->urgent = g_ascii_strcasecmp(value, "true") == 0;
111 g_free(value);
112 } else if (strcasecmp(key, "active") == 0) {
113 entry->active = g_ascii_strcasecmp(value, "true") == 0;
114 g_free(value);
115 } else {
116 g_free(value);
117 }
118 g_free(key);
119 }
120 // Got an extra entry.. lets free it.
121 if (*extras != NULL) {
122 g_free(*extras);
123 }
124 g_free(extras);
125}
126
131static void parse_header_entry(Mode *sw, char *line, ssize_t length) {
133 ssize_t length_key = 0; // strlen ( line );
134 while (length_key < length && line[length_key] != '\x1f') {
135 length_key++;
136 }
137
138 if ((length_key + 1) < length) {
139 line[length_key] = '\0';
140 char *value = line + length_key + 1;
141 if (strcasecmp(line, "message") == 0) {
142 g_free(pd->message);
143 pd->message = strlen(value) ? g_strdup(value) : NULL;
144 } else if (strcasecmp(line, "prompt") == 0) {
145 g_free(pd->prompt);
146 pd->prompt = g_strdup(value);
147 sw->display_name = pd->prompt;
148 } else if (strcasecmp(line, "markup-rows") == 0) {
149 pd->do_markup = (strcasecmp(value, "true") == 0);
150 } else if (strcasecmp(line, "urgent") == 0) {
151 parse_ranges(value, &(pd->urgent_list), &(pd->num_urgent_list));
152 } else if (strcasecmp(line, "active") == 0) {
153 parse_ranges(value, &(pd->active_list), &(pd->num_active_list));
154 } else if (strcasecmp(line, "delim") == 0) {
155 pd->delim = helper_parse_char(value);
156 } else if (strcasecmp(line, "no-custom") == 0) {
157 pd->no_custom = (strcasecmp(value, "true") == 0);
158 } else if (strcasecmp(line, "use-hot-keys") == 0) {
159 pd->use_hot_keys = (strcasecmp(value, "true") == 0);
160 } else if (strcasecmp(line, "keep-selection") == 0) {
161 pd->keep_selection = (strcasecmp(value, "true") == 0);
162 } else if (strcasecmp(line, "keep-filter") == 0) {
163 pd->keep_filter = (strcasecmp(value, "true") == 0);
164 } else if (strcasecmp(line, "new-selection") == 0) {
165 pd->new_selection = (int64_t)g_ascii_strtoll(value, NULL, 0);
166 } else if (strcasecmp(line, "data") == 0) {
167 g_free(pd->data);
168 pd->data = g_strdup(value);
169 } else if (strcasecmp(line, "theme") == 0) {
170 if (rofi_theme_parse_string((const char *)value)) {
171 g_warning("Failed to parse: '%s'", value);
173 }
174 }
175 }
176}
177
179 unsigned int *length, int value,
180 DmenuScriptEntry *entry) {
182 int fd = -1;
183 GError *error = NULL;
184 DmenuScriptEntry *retv = NULL;
185 char **argv = NULL;
186 int argc = 0;
187 *length = 0;
188 // Reset these between runs.
189 pd->new_selection = -1;
190 pd->keep_selection = 0;
191 pd->keep_filter = 0;
192 // Environment
193 char **env = g_get_environ();
194
195 char *str_value = g_strdup_printf("%d", value);
196 env = g_environ_setenv(env, "ROFI_RETV", str_value, TRUE);
197 g_free(str_value);
198
199 str_value = g_strdup_printf("%d", (int)getpid());
200 env = g_environ_setenv(env, "ROFI_OUTSIDE", str_value, TRUE);
201 g_free(str_value);
202
203 if (entry && entry->info) {
204 env = g_environ_setenv(env, "ROFI_INFO", entry->info, TRUE);
205 }
206 if (pd->data) {
207 env = g_environ_setenv(env, "ROFI_DATA", pd->data, TRUE);
208 }
209
210 if (g_shell_parse_argv(sw->ed, &argc, &argv, &error)) {
211 argv = g_realloc(argv, (argc + 2) * sizeof(char *));
212 argv[argc] = g_strdup(arg);
213 argv[argc + 1] = NULL;
214 g_spawn_async_with_pipes(NULL, argv, env, G_SPAWN_SEARCH_PATH, NULL, NULL,
215 NULL, NULL, &fd, NULL, &error);
216 }
217 g_strfreev(env);
218 if (error != NULL) {
219 char *msg = g_strdup_printf("Failed to execute: '%s'\nError: '%s'",
220 (char *)sw->ed, error->message);
221 rofi_view_error_dialog(msg, FALSE);
222 g_free(msg);
223 // print error.
224 g_error_free(error);
225 fd = -1;
226 }
227 if (fd >= 0) {
228 FILE *inp = fdopen(fd, "r");
229 if (inp) {
230 char *buffer = NULL;
231 size_t buffer_length = 0;
232 ssize_t read_length = 0;
233 size_t actual_size = 0;
234 while ((read_length = getdelim(&buffer, &buffer_length, pd->delim, inp)) >
235 0) {
236 // Filter out line-end.
237 if (buffer[read_length - 1] == pd->delim) {
238 buffer[read_length - 1] = '\0';
239 }
240 if (buffer[0] == '\0') {
241 parse_header_entry(sw, &buffer[1], read_length - 1);
242 } else {
243 if (actual_size < ((*length) + 2)) {
244 actual_size += 256;
245 retv = g_realloc(retv, (actual_size) * sizeof(DmenuScriptEntry));
246 }
247 if (retv) {
248 size_t buf_length = strlen(buffer) + 1;
249#if GLIB_CHECK_VERSION(2, 68, 0)
250 retv[(*length)].entry = g_memdup2(buffer, buf_length);
251#else
252 retv[(*length)].entry = g_memdup(buffer, buf_length);
253#endif
254 retv[(*length)].icon_name = NULL;
255 retv[(*length)].display = NULL;
256 retv[(*length)].meta = NULL;
257 retv[(*length)].info = NULL;
258 retv[(*length)].active = FALSE;
259 retv[(*length)].urgent = FALSE;
260 retv[(*length)].icon_fetch_uid = 0;
261 retv[(*length)].icon_fetch_size = 0;
262 retv[(*length)].nonselectable = FALSE;
263 retv[(*length)].permanent = FALSE;
264 if (buf_length > 0 && (read_length > (ssize_t)buf_length)) {
265 dmenuscript_parse_entry_extras(sw, &(retv[(*length)]),
266 buffer + buf_length,
267 read_length - buf_length);
268 }
269 memset(&(retv[(*length) + 1]), 0, sizeof(DmenuScriptEntry));
270 (*length)++;
271 }
272 }
273 }
274 if (buffer) {
275 free(buffer);
276 }
277 if (fclose(inp) != 0) {
278 g_warning("Failed to close stdout off executor script: '%s'",
279 g_strerror(errno));
280 }
281 }
282 }
283 g_strfreev(argv);
284 return retv;
285}
286
287static void script_switcher_free(Mode *sw) {
288 if (sw == NULL) {
289 return;
290 }
291 g_free(sw->name);
292 g_free(sw->ed);
293 g_free(sw);
294}
295
296static int script_mode_init(Mode *sw) {
297 if (sw->private_data == NULL) {
298 ScriptModePrivateData *pd = g_malloc0(sizeof(*pd));
299 pd->delim = '\n';
300 sw->private_data = (void *)pd;
301 pd->cmd_list = execute_executor(sw, NULL, &(pd->cmd_list_length), 0, NULL);
302 }
303 return TRUE;
304}
305static unsigned int script_mode_get_num_entries(const Mode *sw) {
306 const ScriptModePrivateData *rmpd =
308 return rmpd->cmd_list_length;
309}
310
313
314 rmpd->num_urgent_list = 0;
315 g_free(rmpd->urgent_list);
316 rmpd->urgent_list = NULL;
317 rmpd->num_active_list = 0;
318 g_free(rmpd->active_list);
319 rmpd->active_list = NULL;
320}
321
322static ModeMode script_mode_result(Mode *sw, int mretv, char **input,
323 unsigned int selected_line) {
325 ModeMode retv = MODE_EXIT;
326 DmenuScriptEntry *new_list = NULL;
327 unsigned int new_length = 0;
328 // store them as they might be different on next executor and reset.
329 gboolean keep_filter = rmpd->keep_filter;
330 gboolean keep_selection = rmpd->keep_selection;
331
332 if ((mretv & MENU_CUSTOM_COMMAND)) {
333 if (rmpd->use_hot_keys) {
335 if (selected_line != UINT32_MAX) {
336 new_list = execute_executor(sw, rmpd->cmd_list[selected_line].entry,
337 &new_length, 10 + (mretv & MENU_LOWER_MASK),
338 &(rmpd->cmd_list[selected_line]));
339 } else {
340 if (rmpd->no_custom == FALSE) {
341 new_list = execute_executor(sw, *input, &new_length,
342 10 + (mretv & MENU_LOWER_MASK), NULL);
343 } else {
344 return RELOAD_DIALOG;
345 }
346 }
347 } else {
348 retv = (mretv & MENU_LOWER_MASK);
349 return retv;
350 }
351 } else if ((mretv & MENU_OK) && rmpd->cmd_list[selected_line].entry != NULL) {
352 if (rmpd->cmd_list[selected_line].nonselectable) {
353 return RELOAD_DIALOG;
354 }
356 new_list =
357 execute_executor(sw, rmpd->cmd_list[selected_line].entry, &new_length,
358 1, &(rmpd->cmd_list[selected_line]));
359 } else if ((mretv & MENU_CUSTOM_INPUT) && *input != NULL) {
360 if (rmpd->no_custom == FALSE) {
362 new_list = execute_executor(sw, *input, &new_length, 2, NULL);
363 } else {
364 return RELOAD_DIALOG;
365 }
366 }
367
368 // If a new list was generated, use that an loop around.
369 if (new_list != NULL) {
370 for (unsigned int i = 0; i < rmpd->cmd_list_length; i++) {
371 g_free(rmpd->cmd_list[i].entry);
372 g_free(rmpd->cmd_list[i].icon_name);
373 g_free(rmpd->cmd_list[i].display);
374 g_free(rmpd->cmd_list[i].meta);
375 g_free(rmpd->cmd_list[i].info);
376 }
377 g_free(rmpd->cmd_list);
378
379 rmpd->cmd_list = new_list;
380 rmpd->cmd_list_length = new_length;
381 if (keep_selection) {
382 if (rmpd->new_selection >= 0 &&
383 rmpd->new_selection < rmpd->cmd_list_length) {
385 rmpd->new_selection);
386 } else {
388 }
389 } else {
391 }
392 if (keep_filter == FALSE) {
393 g_free(*input);
394 *input = NULL;
395 }
396 retv = RELOAD_DIALOG;
397 }
398 return retv;
399}
400
401static void script_mode_destroy(Mode *sw) {
403 if (rmpd != NULL) {
404 for (unsigned int i = 0; i < rmpd->cmd_list_length; i++) {
405 g_free(rmpd->cmd_list[i].entry);
406 g_free(rmpd->cmd_list[i].icon_name);
407 g_free(rmpd->cmd_list[i].display);
408 g_free(rmpd->cmd_list[i].meta);
409 }
410 g_free(rmpd->cmd_list);
411 g_free(rmpd->message);
412 g_free(rmpd->prompt);
413 g_free(rmpd->data);
414 g_free(rmpd->urgent_list);
415 g_free(rmpd->active_list);
416 g_free(rmpd);
417 sw->private_data = NULL;
418 }
419}
420static inline unsigned int get_index(unsigned int length, int index) {
421 if (index >= 0) {
422 return index;
423 }
424 if (((unsigned int)-index) <= length) {
425 return length + index;
426 }
427 // Out of range.
428 return UINT_MAX;
429}
430static char *_get_display_value(const Mode *sw, unsigned int selected_line,
431 G_GNUC_UNUSED int *state,
432 G_GNUC_UNUSED GList **list, int get_entry) {
434 for (unsigned int i = 0; i < pd->num_active_list; i++) {
435 unsigned int start =
437 unsigned int stop = get_index(pd->cmd_list_length, pd->active_list[i].stop);
438 if (selected_line >= start && selected_line <= stop) {
439 *state |= ACTIVE;
440 }
441 }
442 for (unsigned int i = 0; i < pd->num_urgent_list; i++) {
443 unsigned int start =
445 unsigned int stop = get_index(pd->cmd_list_length, pd->urgent_list[i].stop);
446 if (selected_line >= start && selected_line <= stop) {
447 *state |= URGENT;
448 }
449 }
450 if (pd->cmd_list[selected_line].urgent) {
451 *state |= URGENT;
452 }
453 if (pd->cmd_list[selected_line].active) {
454 *state |= ACTIVE;
455 }
456 if (pd->do_markup) {
457 *state |= MARKUP;
458 }
459 if (pd->cmd_list[selected_line].display) {
460 return get_entry ? g_strdup(pd->cmd_list[selected_line].display) : NULL;
461 } else {
462 return get_entry ? g_strdup(pd->cmd_list[selected_line].entry) : NULL;
463 }
464}
465
466static int script_token_match(const Mode *sw, rofi_int_matcher **tokens,
467 unsigned int index) {
470 char *esc = NULL;
471
472 if (rmpd->cmd_list[index].permanent == TRUE) {
473 // Always match
474 return 1;
475 }
476
477 if (rmpd->do_markup) {
478 pango_parse_markup(rmpd->cmd_list[index].entry, -1, 0, NULL, &esc, NULL,
479 NULL);
480 } else {
481 esc = rmpd->cmd_list[index].entry;
482 }
483 if (esc) {
484 int match = 1;
485 if (tokens) {
486 for (int j = 0; match && tokens[j] != NULL; j++) {
487 rofi_int_matcher *ftokens[2] = {tokens[j], NULL};
488 int test = 0;
489 test = helper_token_match(ftokens, esc);
490 if (test == tokens[j]->invert && rmpd->cmd_list[index].meta) {
491 test = helper_token_match(ftokens, rmpd->cmd_list[index].meta);
492 }
493
494 if (test == 0) {
495 match = 0;
496 }
497 }
498 }
499 if (rmpd->do_markup) {
500 g_free(esc);
501 }
502 return match;
503 }
504 return FALSE;
505}
506static char *script_get_message(const Mode *sw) {
508 return g_strdup(pd->message);
509}
510static cairo_surface_t *script_get_icon(const Mode *sw,
511 unsigned int selected_line,
512 unsigned int height) {
515 g_return_val_if_fail(pd->cmd_list != NULL, NULL);
516 DmenuScriptEntry *dr = &(pd->cmd_list[selected_line]);
517 if (dr->icon_name == NULL) {
518 return NULL;
519 }
520 if (dr->icon_fetch_uid > 0 && dr->icon_fetch_size == height) {
522 }
524 dr->icon_fetch_size = height;
526}
527
528#include "mode-private.h"
529
533typedef struct ScriptUser {
535 char *name;
537 char *path;
539
543size_t num_scripts = 0;
544
546 for (size_t i = 0; i < num_scripts; i++) {
547 g_free(user_scripts[i].name);
548 g_free(user_scripts[i].path);
549 }
550 g_free(user_scripts);
551}
553 const char *cpath = g_get_user_config_dir();
554 char *script_dir = g_build_filename(cpath, "rofi", "scripts", NULL);
555 if (g_file_test(script_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR) ==
556 FALSE) {
557 g_free(script_dir);
558 return;
559 }
560 GDir *sd = g_dir_open(script_dir, 0, NULL);
561 if (sd) {
562 const char *file = NULL;
563 while ((file = g_dir_read_name(sd)) != NULL) {
564 char *sp = g_build_filename(cpath, "rofi", "scripts", file, NULL);
566 g_realloc(user_scripts, sizeof(ScriptUser) * (num_scripts + 1));
568 user_scripts[num_scripts].name = g_strdup(file);
569 char *dot = strrchr(user_scripts[num_scripts].name, '.');
570 if (dot) {
571 *dot = '\0';
572 }
573 num_scripts++;
574 }
575 g_dir_close(sd);
576 }
577
578 g_free(script_dir);
579}
580
581static int script_mode_has_user_script(char const *const user) {
582
583 for (size_t i = 0; i < num_scripts; i++) {
584 if (g_strcmp0(user_scripts[i].name, user) == 0) {
585 return i;
586 }
587 }
588 return -1;
589}
590
591Mode *script_mode_parse_setup(const char *str) {
592 int ui = 0;
593 if ((ui = script_mode_has_user_script(str)) >= 0) {
594 Mode *sw = g_malloc0(sizeof(*sw));
595 sw->name = g_strdup(user_scripts[ui].name);
596 sw->ed = g_strdup(user_scripts[ui].path);
605 sw->_get_completion = NULL, sw->_preprocess_input = NULL,
608 return sw;
609 }
610 Mode *sw = g_malloc0(sizeof(*sw));
611 unsigned int index = 0;
612 const char *const sep = ":";
613 char **tokens = g_strsplit(str, sep, 2);
614 if (tokens) {
615 index = g_strv_length(tokens);
616 sw->name = g_strdup(tokens[0]);
617 sw->ed = (void *)rofi_expand_path(tokens[1]);
618 g_strfreev(tokens);
619 }
620 if (index == 2) {
629 sw->_get_completion = NULL, sw->_preprocess_input = NULL,
632
633 return sw;
634 }
635 fprintf(
636 stderr,
637 "The script command '%s' has %u options, but needs 2: <name>:<script>.",
638 str, index);
640 return NULL;
641}
642
643gboolean script_mode_is_valid(const char *token) {
644 if (script_mode_has_user_script(token) >= 0) {
645 return TRUE;
646 }
647 return strchr(token, ':') != NULL;
648}
649
650void script_user_list(gboolean is_term) {
651
652 for (unsigned int i = 0; i < num_scripts; i++) {
653 printf(" • %s%s%s (%s)\n", is_term ? (color_bold) : "",
654 user_scripts[i].name, is_term ? color_reset : "",
655 user_scripts[i].path);
656 }
657}
void parse_ranges(char *input, rofi_range_pair **list, unsigned int *length)
Definition helper.c:1233
char helper_parse_char(const char *arg)
Definition helper.c:357
char * rofi_expand_path(const char *input)
Definition helper.c:738
int helper_token_match(rofi_int_matcher *const *tokens, const char *input)
Definition helper.c:515
cairo_surface_t * rofi_icon_fetcher_get(const uint32_t uid)
uint32_t rofi_icon_fetcher_query(const char *name, const int size)
void * mode_get_private_data(const Mode *mode)
Definition mode.c:171
ModeMode
Definition mode.h:49
@ MENU_CUSTOM_COMMAND
Definition mode.h:79
@ MENU_LOWER_MASK
Definition mode.h:87
@ MENU_OK
Definition mode.h:67
@ MENU_CUSTOM_INPUT
Definition mode.h:73
@ MODE_EXIT
Definition mode.h:51
@ RELOAD_DIALOG
Definition mode.h:55
#define color_reset
Definition rofi.h:115
#define color_bold
Definition rofi.h:117
void rofi_clear_error_messages(void)
Definition rofi.c:98
void script_mode_gather_user_scripts(void)
Definition script.c:552
gboolean script_mode_is_valid(const char *token)
Definition script.c:643
void script_user_list(gboolean is_term)
Definition script.c:650
void script_mode_cleanup(void)
Definition script.c:545
Mode * script_mode_parse_setup(const char *str)
Definition script.c:591
@ URGENT
Definition textbox.h:106
@ ACTIVE
Definition textbox.h:108
@ MARKUP
Definition textbox.h:112
int rofi_view_error_dialog(const char *msg, int markup)
Definition view.c:2574
RofiViewState * rofi_view_get_active(void)
Definition view.c:607
void rofi_view_set_selected_line(RofiViewState *state, unsigned int selected_line)
Definition view.c:639
@ MODE_TYPE_SWITCHER
static void script_mode_destroy(Mode *sw)
Definition script.c:401
static void script_switcher_free(Mode *sw)
Definition script.c:287
static void parse_header_entry(Mode *sw, char *line, ssize_t length)
Definition script.c:131
static ModeMode script_mode_result(Mode *sw, int mretv, char **input, unsigned int selected_line)
Definition script.c:322
static cairo_surface_t * script_get_icon(const Mode *sw, unsigned int selected_line, unsigned int height)
Definition script.c:510
void dmenuscript_parse_entry_extras(G_GNUC_UNUSED Mode *sw, DmenuScriptEntry *entry, char *buffer, G_GNUC_UNUSED size_t length)
Definition script.c:84
static unsigned int get_index(unsigned int length, int index)
Definition script.c:420
static char * script_get_message(const Mode *sw)
Definition script.c:506
ScriptUser * user_scripts
Definition script.c:541
static int script_mode_has_user_script(char const *const user)
Definition script.c:581
size_t num_scripts
Definition script.c:543
static void script_mode_reset_highlight(Mode *sw)
Definition script.c:311
static char * _get_display_value(const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **list, int get_entry)
Definition script.c:430
static int script_mode_init(Mode *sw)
Definition script.c:296
static DmenuScriptEntry * execute_executor(Mode *sw, char *arg, unsigned int *length, int value, DmenuScriptEntry *entry)
Definition script.c:178
static int script_token_match(const Mode *sw, rofi_int_matcher **tokens, unsigned int index)
Definition script.c:466
struct ScriptUser ScriptUser
static unsigned int script_mode_get_num_entries(const Mode *sw)
Definition script.c:305
struct rofi_range_pair * urgent_list
Definition script.c:60
gboolean no_custom
Definition script.c:74
struct rofi_range_pair * active_list
Definition script.c:63
gboolean use_hot_keys
Definition script.c:78
gboolean do_markup
Definition script.c:69
unsigned int num_urgent_list
Definition script.c:61
int64_t new_selection
Definition script.c:71
unsigned int id
Definition script.c:53
unsigned int cmd_list_length
Definition script.c:57
gboolean keep_filter
Definition script.c:76
unsigned int num_active_list
Definition script.c:64
DmenuScriptEntry * cmd_list
Definition script.c:55
gboolean keep_selection
Definition script.c:70
char * name
Definition script.c:535
char * path
Definition script.c:537
_mode_result _result
__mode_get_num_entries _get_num_entries
__mode_destroy _destroy
_mode_preprocess_input _preprocess_input
char * display_name
_mode_free free
_mode_token_match _token_match
_mode_get_display_value _get_display_value
_mode_get_icon _get_icon
_mode_get_completion _get_completion
__mode_init _init
ModeType type
char * name
_mode_get_message _get_message
void * private_data
gboolean rofi_theme_parse_string(const char *string)