rofi 1.7.7
filebrowser.c
Go to the documentation of this file.
1
26#include "config.h"
27#include <errno.h>
28#include <gio/gio.h>
29#include <gmodule.h>
30#include <stdio.h>
31#include <stdlib.h>
32#include <string.h>
33#include <unistd.h>
34
35#include <dirent.h>
36#include <glib/gstdio.h>
37#include <sys/stat.h>
38#include <sys/types.h>
39
40#include "helper.h"
41#include "history.h"
42#include "mode-private.h"
43#include "mode.h"
44#include "modes/filebrowser.h"
45#include "rofi.h"
46#include "theme.h"
47
48#include <stdint.h>
49
50#include "rofi-icon-fetcher.h"
51
52#define FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache"
54#define DEFAULT_OPEN "xdg-open"
55
56#if defined(__APPLE__)
57#define st_atim st_atimespec
58#define st_ctim st_ctimespec
59#define st_mtim st_mtimespec
60#endif
61
71
79
88
90const char *icon_name[NUM_FILE_TYPES] = {"go-up", "folder", "gtk-file"};
91typedef struct {
92 char *name;
93 char *path;
97 gboolean link;
98 time_t time;
99} FBFile;
100
101typedef struct {
102 char *command;
105 unsigned int array_length;
106 unsigned int array_length_real;
108
112struct {
120 gboolean show_hidden;
122 .sorting_method = FB_SORT_NAME,
123 .sorting_time = FB_MTIME,
124 .directories_first = TRUE,
125 .show_hidden = FALSE,
127
129 for (unsigned int i = 0; i < pd->array_length; i++) {
130 FBFile *fb = &(pd->array[i]);
131 g_free(fb->name);
132 g_free(fb->path);
133 }
134 g_free(pd->array);
135 pd->array = NULL;
136 pd->array_length = 0;
137 pd->array_length_real = 0;
138}
139#include <dirent.h>
140#include <sys/types.h>
141
142static gint compare_name(gconstpointer a, gconstpointer b,
143 G_GNUC_UNUSED gpointer data) {
144 FBFile *fa = (FBFile *)a;
145 FBFile *fb = (FBFile *)b;
146
147 if (file_browser_config.directories_first && fa->type != fb->type) {
148 return fa->type - fb->type;
149 }
150
151 return g_strcmp0(fa->name, fb->name);
152}
153
154static gint compare_time(gconstpointer a, gconstpointer b,
155 G_GNUC_UNUSED gpointer data) {
156 FBFile *fa = (FBFile *)a;
157 FBFile *fb = (FBFile *)b;
158
159 if (file_browser_config.directories_first && fa->type != fb->type) {
160 return fa->type - fb->type;
161 }
162
163 if (fa->time < 0) {
164 return -1;
165 }
166
167 if (fb->time < 0) {
168 return 1;
169 }
170
171 return fb->time - fa->time;
172}
173
174static gint compare(gconstpointer a, gconstpointer b, gpointer data) {
175 GCompareDataFunc comparator = NULL;
176
177 switch (file_browser_config.sorting_method) {
178 case FB_SORT_NAME:
179 comparator = compare_name;
180 break;
181 case FB_SORT_TIME:
182 comparator = compare_time;
183 break;
184 default:
185 comparator = compare_name;
186 break;
187 }
188
189 return comparator(a, b, data);
190}
191
192static time_t get_time(const GStatBuf *statbuf) {
193 switch (file_browser_config.sorting_time) {
194 case FB_MTIME:
195 return statbuf->st_mtim.tv_sec;
196 case FB_ATIME:
197 return statbuf->st_atim.tv_sec;
198 case FB_CTIME:
199 return statbuf->st_ctim.tv_sec;
200 default:
201 return 0;
202 }
203}
204
205static void set_time(FBFile *file) {
206 // GError *error = NULL;
207 // gchar *path = g_filename_from_utf8(file->path, -1, NULL, NULL, &error);
208 // if (error) {
209 // g_warning("Failed to convert filename: %s: %s", file->path,
210 // error->message); g_error_free(error); return;
211 // }
212
213 GStatBuf statbuf;
214
215 if (g_lstat(file->path, &statbuf) == 0) {
216 file->time = get_time(&statbuf);
217 } else {
218 g_warning("Failed to stat file: %s, %s", file->path, strerror(errno));
219 }
220
221 // g_free(path);
222}
223
225 if ((pd->array_length + 1) > pd->array_length_real) {
226 pd->array_length_real += 256;
227 pd->array =
228 g_realloc(pd->array, (pd->array_length_real + 1) * sizeof(FBFile));
229 }
230}
231
232static void get_file_browser(Mode *sw) {
239 char *cdir = g_file_get_path(pd->current_dir);
240 DIR *dir = opendir(cdir);
241 if (dir) {
242 struct dirent *rd = NULL;
243 while ((rd = readdir(dir)) != NULL) {
244 if (g_strcmp0(rd->d_name, "..") == 0) {
245 fb_resize_array(pd);
246 // Rofi expects utf-8, so lets convert the filename.
247 pd->array[pd->array_length].name = g_strdup("..");
248 pd->array[pd->array_length].path = NULL;
249 pd->array[pd->array_length].type = UP;
250 pd->array[pd->array_length].icon_fetch_uid = 0;
252 pd->array[pd->array_length].link = FALSE;
253 pd->array[pd->array_length].time = -1;
254 pd->array_length++;
255 continue;
256 }
257 if (g_strcmp0(rd->d_name, ".") == 0) {
258 continue;
259 }
260 if (rd->d_name[0] == '.' && file_browser_config.show_hidden == FALSE) {
261 continue;
262 }
263
264 switch (rd->d_type) {
265 case DT_BLK:
266 case DT_CHR:
267 case DT_FIFO:
268 case DT_UNKNOWN:
269 case DT_SOCK:
270 default:
271 break;
272 case DT_REG:
273 case DT_DIR:
274 fb_resize_array(pd);
275 // Rofi expects utf-8, so lets convert the filename.
276 pd->array[pd->array_length].name =
277 g_filename_to_utf8(rd->d_name, -1, NULL, NULL, NULL);
278 if (pd->array[pd->array_length].name == NULL) {
279 pd->array[pd->array_length].name = rofi_force_utf8(rd->d_name, -1);
280 }
281 pd->array[pd->array_length].path =
282 g_build_filename(cdir, rd->d_name, NULL);
283 pd->array[pd->array_length].type =
284 (rd->d_type == DT_DIR) ? DIRECTORY : RFILE;
285 pd->array[pd->array_length].icon_fetch_uid = 0;
287 pd->array[pd->array_length].link = FALSE;
288
289 if (file_browser_config.sorting_method == FB_SORT_TIME) {
290 set_time(&pd->array[pd->array_length]);
291 }
292
293 pd->array_length++;
294 break;
295 case DT_LNK:
296 fb_resize_array(pd);
297 // Rofi expects utf-8, so lets convert the filename.
298 pd->array[pd->array_length].name =
299 g_filename_to_utf8(rd->d_name, -1, NULL, NULL, NULL);
300 if (pd->array[pd->array_length].name == NULL) {
301 pd->array[pd->array_length].name = rofi_force_utf8(rd->d_name, -1);
302 }
303 pd->array[pd->array_length].path =
304 g_build_filename(cdir, rd->d_name, NULL);
305 pd->array[pd->array_length].icon_fetch_uid = 0;
307 pd->array[pd->array_length].link = TRUE;
308 // Default to file.
309 pd->array[pd->array_length].type = RFILE;
310 {
311 // If we have link, use a stat to fine out what it is, if we fail, we
312 // mark it as file.
313 // TODO have a 'broken link' mode?
314 // Convert full path to right encoding.
315 // DD: Path should be in file encoding, not utf-8
316 // char *file =
317 // g_filename_from_utf8(pd->array[pd->array_length].path,
318 // -1, NULL, NULL, NULL);
319 if (pd->array[pd->array_length].path) {
320 GStatBuf statbuf;
321 if (g_stat(pd->array[pd->array_length].path, &statbuf) == 0) {
322 if (S_ISDIR(statbuf.st_mode)) {
323 pd->array[pd->array_length].type = DIRECTORY;
324 } else if (S_ISREG(statbuf.st_mode)) {
325 pd->array[pd->array_length].type = RFILE;
326 }
327
328 if (file_browser_config.sorting_method == FB_SORT_TIME) {
329 pd->array[pd->array_length].time = get_time(&statbuf);
330 }
331 } else {
332 g_warning("Failed to stat file: %s, %s",
333 pd->array[pd->array_length].path, strerror(errno));
334 }
335
336 // g_free(file);
337 }
338 }
339 pd->array_length++;
340 break;
341 }
342 }
343 closedir(dir);
344 }
345 g_free(cdir);
346 g_qsort_with_data(pd->array, pd->array_length, sizeof(FBFile), compare, NULL);
347}
348
352 char *msg = NULL;
353 gboolean found_error = FALSE;
354
355 ThemeWidget *wid = rofi_config_find_widget(sw->name, NULL, TRUE);
356
357 Property *p = rofi_theme_find_property(wid, P_STRING, "sorting-method", TRUE);
358 if (p != NULL && p->type == P_STRING) {
359 if (g_strcmp0(p->value.s, "name") == 0) {
360 file_browser_config.sorting_method = FB_SORT_NAME;
361 } else if (g_strcmp0(p->value.s, "mtime") == 0) {
362 file_browser_config.sorting_method = FB_SORT_TIME;
363 file_browser_config.sorting_time = FB_MTIME;
364 } else if (g_strcmp0(p->value.s, "atime") == 0) {
365 file_browser_config.sorting_method = FB_SORT_TIME;
366 file_browser_config.sorting_time = FB_ATIME;
367 } else if (g_strcmp0(p->value.s, "ctime") == 0) {
368 file_browser_config.sorting_method = FB_SORT_TIME;
369 file_browser_config.sorting_time = FB_CTIME;
370 } else {
371 found_error = TRUE;
372
373 msg = g_strdup_printf("\"%s\" is not a valid filebrowser sorting method",
374 p->value.s);
375 }
376 }
377
378 p = rofi_theme_find_property(wid, P_BOOLEAN, "directories-first", TRUE);
379 if (p != NULL && p->type == P_BOOLEAN) {
380 file_browser_config.directories_first = p->value.b;
381 }
382
383 p = rofi_theme_find_property(wid, P_BOOLEAN, "show-hidden", TRUE);
384 if (p != NULL && p->type == P_BOOLEAN) {
385 file_browser_config.show_hidden = p->value.b;
386 }
387
388 p = rofi_theme_find_property(wid, P_STRING, "command", TRUE);
389 if (p != NULL && p->type == P_STRING) {
390 pd->command = g_strdup(p->value.s);
391 } else {
392 pd->command = g_strdup(DEFAULT_OPEN);
393 }
394
395 if (found_error) {
396 rofi_view_error_dialog(msg, FALSE);
397
398 g_free(msg);
399 }
400}
401
405
406 ThemeWidget *wid = rofi_config_find_widget(sw->name, NULL, TRUE);
407
408 Property *p = rofi_theme_find_property(wid, P_STRING, "directory", TRUE);
409
410 gboolean config_has_valid_dir = p != NULL && p->type == P_STRING &&
411 g_file_test(p->value.s, G_FILE_TEST_IS_DIR);
412
413 if (config_has_valid_dir) {
414 pd->current_dir = g_file_new_for_path(p->value.s);
415 } else {
416 char *current_dir = NULL;
417 char *cache_file =
418 g_build_filename(cache_dir, FILEBROWSER_CACHE_FILE, NULL);
419
420 if (g_file_get_contents(cache_file, &current_dir, NULL, NULL)) {
421 if (g_file_test(current_dir, G_FILE_TEST_IS_DIR)) {
422 pd->current_dir = g_file_new_for_path(current_dir);
423 }
424
425 g_free(current_dir);
426 }
427
428 // Store it based on the unique identifiers (desktop_id).
429 g_free(cache_file);
430 }
431
432 if (pd->current_dir == NULL) {
433 pd->current_dir = g_file_new_for_path(g_get_home_dir());
434 }
435}
436
441 if (mode_get_private_data(sw) == NULL) {
442 FileBrowserModePrivateData *pd = g_malloc0(sizeof(*pd));
443 mode_set_private_data(sw, (void *)pd);
444
447
448 // Load content.
450 }
451 return TRUE;
452}
453static unsigned int file_browser_mode_get_num_entries(const Mode *sw) {
456 return pd->array_length;
457}
458
459static ModeMode file_browser_mode_result(Mode *sw, int mretv, char **input,
460 unsigned int selected_line) {
461 ModeMode retv = MODE_EXIT;
464
465 if ((mretv & MENU_CANCEL) == MENU_CANCEL) {
466 ThemeWidget *wid = rofi_config_find_widget(sw->name, NULL, TRUE);
467 Property *p =
468 rofi_theme_find_property(wid, P_BOOLEAN, "cancel-returns-1", TRUE);
469 if (p && p->type == P_BOOLEAN && p->value.b == TRUE) {
471 }
472 return MODE_EXIT;
473 }
474 gboolean special_command =
476 if (mretv & MENU_CUSTOM_COMMAND) {
477 retv = (mretv & MENU_LOWER_MASK);
478 } else if ((mretv & MENU_OK)) {
479 if (selected_line < pd->array_length) {
480 if (pd->array[selected_line].type == UP) {
481 GFile *new = g_file_get_parent(pd->current_dir);
482 if (new) {
483 g_object_unref(pd->current_dir);
484 pd->current_dir = new;
485 free_list(pd);
487 return RESET_DIALOG;
488 }
489 } else if ((pd->array[selected_line].type == RFILE) ||
490 (pd->array[selected_line].type == DIRECTORY &&
491 special_command)) {
492 char *d_esc = g_shell_quote(pd->array[selected_line].path);
493 char *cmd = g_strdup_printf("%s %s", pd->command, d_esc);
494 g_free(d_esc);
495 char *cdir = g_file_get_path(pd->current_dir);
496 helper_execute_command(cdir, cmd, FALSE, NULL);
497 g_free(cdir);
498 g_free(cmd);
499 return MODE_EXIT;
500 } else if (pd->array[selected_line].type == DIRECTORY) {
501 char *path = g_build_filename(cache_dir, FILEBROWSER_CACHE_FILE, NULL);
502 g_file_set_contents(path, pd->array[selected_line].path, -1, NULL);
503 g_free(path);
504 GFile *new = g_file_new_for_path(pd->array[selected_line].path);
505 g_object_unref(pd->current_dir);
506 pd->current_dir = new;
507 free_list(pd);
509 return RESET_DIALOG;
510 }
511 }
512 retv = RELOAD_DIALOG;
513 } else if ((mretv & MENU_CUSTOM_INPUT)) {
514 if (special_command) {
515 GFile *new = g_file_get_parent(pd->current_dir);
516 if (new) {
517 g_object_unref(pd->current_dir);
518 pd->current_dir = new;
519 free_list(pd);
521 }
522 return RESET_DIALOG;
523 }
524 if (*input) {
525 char *p = rofi_expand_path(*input);
526 char *dir = g_filename_from_utf8(p, -1, NULL, NULL, NULL);
527 g_free(p);
528 if (g_file_test(dir, G_FILE_TEST_EXISTS)) {
529 if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
530 g_object_unref(pd->current_dir);
531 pd->current_dir = g_file_new_for_path(dir);
532 g_free(dir);
533 free_list(pd);
535 return RESET_DIALOG;
536 }
537 }
538 g_free(dir);
539 retv = RELOAD_DIALOG;
540 }
541 } else if ((mretv & MENU_ENTRY_DELETE) == MENU_ENTRY_DELETE) {
542 file_browser_config.show_hidden = !file_browser_config.show_hidden;
543 free_list(pd);
545 retv = RELOAD_DIALOG;
546 }
547 return retv;
548}
549
553 if (pd != NULL) {
554 g_object_unref(pd->current_dir);
555 g_free(pd->command);
556 free_list(pd);
557 g_free(pd);
558 mode_set_private_data(sw, NULL);
559 }
560}
561
562static char *_get_display_value(const Mode *sw, unsigned int selected_line,
563 G_GNUC_UNUSED int *state,
564 G_GNUC_UNUSED GList **attr_list,
565 int get_entry) {
568
569 // Only return the string if requested, otherwise only set state.
570 if (!get_entry) {
571 return NULL;
572 }
573 if (pd->array[selected_line].type == UP) {
574 return g_strdup(" ..");
575 }
576 if (pd->array[selected_line].link) {
577 return g_strconcat("@", pd->array[selected_line].name, NULL);
578 }
579 return g_strdup(pd->array[selected_line].name);
580}
581
591static int file_browser_token_match(const Mode *sw, rofi_int_matcher **tokens,
592 unsigned int index) {
595
596 // Call default matching function.
597 return helper_token_match(tokens, pd->array[index].name);
598}
599
600static cairo_surface_t *_get_icon(const Mode *sw, unsigned int selected_line,
601 unsigned int height) {
604 g_return_val_if_fail(pd->array != NULL, NULL);
605 FBFile *dr = &(pd->array[selected_line]);
608 } else if (dr->type == RFILE) {
609 gchar* _path = g_strconcat("thumbnail://", dr->path, NULL);
610 dr->icon_fetch_uid = rofi_icon_fetcher_query(_path, height);
611 g_free(_path);
612 } else {
614 }
615 dr->icon_fetch_size = height;
617}
618
619static char *_get_message(const Mode *sw) {
622 if (pd->current_dir) {
623 char *dirname = g_file_get_parse_name(pd->current_dir);
624 char *str =
625 g_markup_printf_escaped("<b>Current directory:</b> %s", dirname);
626 g_free(dirname);
627 return str;
628 }
629 return "n/a";
630}
631
632static char *_get_completion(const Mode *sw, unsigned int index) {
635
636 char *d = g_strescape(pd->array[index].path, NULL);
637 return d;
638}
639
641 Mode *sw = g_malloc0(sizeof(Mode));
642
643 *sw = file_browser_mode;
644
645 sw->private_data = NULL;
646 return sw;
647}
648
649#if 1
650ModeMode file_browser_mode_completer(Mode *sw, int mretv, char **input,
651 unsigned int selected_line, char **path) {
652 ModeMode retv = MODE_EXIT;
655 if ((mretv & MENU_OK)) {
656 if (selected_line < pd->array_length) {
657 if (pd->array[selected_line].type == UP) {
658 GFile *new = g_file_get_parent(pd->current_dir);
659 if (new) {
660 g_object_unref(pd->current_dir);
661 pd->current_dir = new;
662 free_list(pd);
664 return RESET_DIALOG;
665 }
666 } else if (pd->array[selected_line].type == DIRECTORY) {
667 GFile *new = g_file_new_for_path(pd->array[selected_line].path);
668 g_object_unref(pd->current_dir);
669 pd->current_dir = new;
670 free_list(pd);
672 return RESET_DIALOG;
673 } else if (pd->array[selected_line].type == RFILE) {
674 *path = g_strescape(pd->array[selected_line].path, NULL);
675 return MODE_EXIT;
676 }
677 }
678 retv = RELOAD_DIALOG;
679 } else if ((mretv & MENU_CUSTOM_INPUT) && *input) {
680 char *p = rofi_expand_path(*input);
681 char *dir = g_filename_from_utf8(p, -1, NULL, NULL, NULL);
682 g_free(p);
683 if (g_file_test(dir, G_FILE_TEST_EXISTS)) {
684 if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
685 g_object_unref(pd->current_dir);
686 pd->current_dir = g_file_new_for_path(dir);
687 g_free(dir);
688 free_list(pd);
690 return RESET_DIALOG;
691 }
692 }
693 g_free(dir);
694 retv = RELOAD_DIALOG;
695 } else if ((mretv & MENU_ENTRY_DELETE) == MENU_ENTRY_DELETE) {
696 file_browser_config.show_hidden = !file_browser_config.show_hidden;
697 free_list(pd);
699 retv = RELOAD_DIALOG;
700 }
701 return retv;
702}
703#endif
704
705Mode file_browser_mode = {.display_name = NULL,
706 .abi_version = ABI_VERSION,
707 .name = "filebrowser",
708 .cfg_name_key = "display-filebrowser",
709 ._init = file_browser_mode_init,
710 ._get_num_entries = file_browser_mode_get_num_entries,
711 ._result = file_browser_mode_result,
712 ._destroy = file_browser_mode_destroy,
713 ._token_match = file_browser_token_match,
714 ._get_display_value = _get_display_value,
715 ._get_icon = _get_icon,
716 ._get_message = _get_message,
717 ._get_completion = _get_completion,
718 ._preprocess_input = NULL,
719 ._create = create_new_file_browser,
720 ._completer_result = file_browser_mode_completer,
721 .private_data = NULL,
722 .free = NULL,
static int file_browser_token_match(const Mode *sw, rofi_int_matcher **tokens, unsigned int index)
static char * _get_message(const Mode *sw)
static void free_list(FileBrowserModePrivateData *pd)
static char * _get_completion(const Mode *sw, unsigned int index)
static unsigned int file_browser_mode_get_num_entries(const Mode *sw)
FBFileType
Definition filebrowser.c:65
@ NUM_FILE_TYPES
Definition filebrowser.c:69
@ DIRECTORY
Definition filebrowser.c:67
@ UP
Definition filebrowser.c:66
@ RFILE
Definition filebrowser.c:68
static cairo_surface_t * _get_icon(const Mode *sw, unsigned int selected_line, unsigned int height)
static void file_browser_mode_init_current_dir(Mode *sw)
static void fb_resize_array(FileBrowserModePrivateData *pd)
static void set_time(FBFile *file)
#define FILEBROWSER_CACHE_FILE
Definition filebrowser.c:52
static gint compare_time(gconstpointer a, gconstpointer b, G_GNUC_UNUSED gpointer data)
static void file_browser_mode_destroy(Mode *sw)
enum FBSortingMethod sorting_method
gboolean show_hidden
enum FBSortingTime sorting_time
static gint compare_name(gconstpointer a, gconstpointer b, G_GNUC_UNUSED gpointer data)
FBSortingMethod
Definition filebrowser.c:75
@ FB_SORT_NAME
Definition filebrowser.c:76
@ FB_SORT_TIME
Definition filebrowser.c:77
struct @121034126322215145046127151100014347273011315334 file_browser_config
static char * _get_display_value(const Mode *sw, unsigned int selected_line, G_GNUC_UNUSED int *state, G_GNUC_UNUSED GList **attr_list, int get_entry)
static void get_file_browser(Mode *sw)
FBSortingTime
Definition filebrowser.c:83
@ FB_CTIME
Definition filebrowser.c:86
@ FB_MTIME
Definition filebrowser.c:84
@ FB_ATIME
Definition filebrowser.c:85
static int file_browser_mode_init(Mode *sw)
static ModeMode file_browser_mode_result(Mode *sw, int mretv, char **input, unsigned int selected_line)
static void file_browser_mode_init_config(Mode *sw)
const char * icon_name[NUM_FILE_TYPES]
Definition filebrowser.c:90
#define DEFAULT_OPEN
Definition filebrowser.c:54
gboolean directories_first
static time_t get_time(const GStatBuf *statbuf)
static gint compare(gconstpointer a, gconstpointer b, gpointer data)
Mode file_browser_mode
Mode * create_new_file_browser(void)
ModeMode file_browser_mode_completer(Mode *sw, int mretv, char **input, unsigned int selected_line, char **path)
Property * rofi_theme_find_property(ThemeWidget *wid, PropertyType type, const char *property, gboolean exact)
Definition theme.c:743
gboolean helper_execute_command(const char *wd, const char *cmd, gboolean run_in_term, RofiHelperExecuteContext *context)
Definition helper.c:1028
ThemeWidget * rofi_config_find_widget(const char *name, const char *state, gboolean exact)
Definition theme.c:780
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
char * rofi_force_utf8(const gchar *data, ssize_t length)
Definition helper.c:812
gboolean rofi_icon_fetcher_file_is_image(const char *const path)
cairo_surface_t * rofi_icon_fetcher_get(const uint32_t uid)
uint32_t rofi_icon_fetcher_query(const char *name, const int size)
struct rofi_mode Mode
Definition mode.h:44
void * mode_get_private_data(const Mode *mode)
Definition mode.c:171
void mode_set_private_data(Mode *mode, void *pd)
Definition mode.c:176
ModeMode
Definition mode.h:49
@ MENU_CUSTOM_COMMAND
Definition mode.h:79
@ MENU_LOWER_MASK
Definition mode.h:87
@ MENU_CANCEL
Definition mode.h:69
@ MENU_ENTRY_DELETE
Definition mode.h:75
@ MENU_CUSTOM_ACTION
Definition mode.h:85
@ 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
@ RESET_DIALOG
Definition mode.h:59
void rofi_set_return_code(int code)
Definition rofi.c:150
const char * cache_dir
Definition rofi.c:84
int rofi_view_error_dialog(const char *msg, int markup)
Definition view.c:2574
#define ABI_VERSION
@ MODE_TYPE_COMPLETER
@ MODE_TYPE_SWITCHER
FBFileType
@ P_BOOLEAN
Definition rofi-types.h:18
@ P_STRING
Definition rofi-types.h:16
struct rofi_int_matcher_t rofi_int_matcher
char * path
Definition filebrowser.c:93
enum FBFileType type
Definition filebrowser.c:94
gboolean link
Definition filebrowser.c:97
uint32_t icon_fetch_size
Definition filebrowser.c:96
char * name
Definition filebrowser.c:92
uint32_t icon_fetch_uid
Definition filebrowser.c:95
time_t time
Definition filebrowser.c:98
PropertyValue value
Definition rofi-types.h:293
PropertyType type
Definition rofi-types.h:291
char * name
void * private_data