rofi 2.1.0
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 "display.h"
41#include "helper.h"
42#include "history.h"
43#include "mode-private.h"
44#include "mode.h"
45#include "modes/filebrowser.h"
46#include "rofi.h"
47#include "theme.h"
48
49#include <stdint.h>
50
51#include "rofi-icon-fetcher.h"
52
53#define FILEBROWSER_CACHE_FILE "rofi3.filebrowsercache"
55#define DEFAULT_OPEN "xdg-open"
56
57#if defined(__APPLE__)
58#define st_atim st_atimespec
59#define st_ctim st_ctimespec
60#define st_mtim st_mtimespec
61#endif
62
72
80
89
91const char *icon_name[NUM_FILE_TYPES] = {"go-up", "folder", "gtk-file"};
92typedef struct {
93 char *name;
94 char *path;
99 gboolean link;
101 time_t time;
103} FBFile;
104
105typedef struct {
106 char *command;
109 unsigned int array_length;
110 unsigned int array_length_real;
112
116struct {
124 gboolean show_hidden;
126 .sorting_method = FB_SORT_NAME,
127 .sorting_time = FB_MTIME,
128 .directories_first = TRUE,
129 .show_hidden = FALSE,
131
133 for (unsigned int i = 0; i < pd->array_length; i++) {
134 FBFile *fb = &(pd->array[i]);
135 g_free(fb->name);
136 g_free(fb->path);
137 g_free(fb->collate_key);
138 }
139 g_free(pd->array);
140 pd->array = NULL;
141 pd->array_length = 0;
142 pd->array_length_real = 0;
143}
144#include <dirent.h>
145#include <sys/types.h>
146
147static gint compare_name(gconstpointer a, gconstpointer b,
148 G_GNUC_UNUSED gpointer data) {
149 FBFile *fa = (FBFile *)a;
150 FBFile *fb = (FBFile *)b;
151
152 if (file_browser_config.directories_first && fa->type != fb->type) {
153 return fa->type - fb->type;
154 }
155
156 return g_strcmp0(fa->collate_key, fb->collate_key);
157}
158
159static gint compare_time(gconstpointer a, gconstpointer b,
160 G_GNUC_UNUSED gpointer data) {
161 FBFile *fa = (FBFile *)a;
162 FBFile *fb = (FBFile *)b;
163
164 if (file_browser_config.directories_first && fa->type != fb->type) {
165 return fa->type - fb->type;
166 }
167
168 if (fa->time < 0) {
169 return -1;
170 }
171
172 if (fb->time < 0) {
173 return 1;
174 }
175
176 return fb->time - fa->time;
177}
178
179static gint compare(gconstpointer a, gconstpointer b, gpointer data) {
180 GCompareDataFunc comparator = NULL;
181
182 switch (file_browser_config.sorting_method) {
183 case FB_SORT_NAME:
184 comparator = compare_name;
185 break;
186 case FB_SORT_TIME:
187 comparator = compare_time;
188 break;
189 default:
190 comparator = compare_name;
191 break;
192 }
193
194 return comparator(a, b, data);
195}
196
197static time_t get_time(const GStatBuf *statbuf) {
198 switch (file_browser_config.sorting_time) {
199 case FB_MTIME:
200 return statbuf->st_mtim.tv_sec;
201 case FB_ATIME:
202 return statbuf->st_atim.tv_sec;
203 case FB_CTIME:
204 return statbuf->st_ctim.tv_sec;
205 default:
206 return 0;
207 }
208}
209
210static void set_time(FBFile *file) {
211 // GError *error = NULL;
212 // gchar *path = g_filename_from_utf8(file->path, -1, NULL, NULL, &error);
213 // if (error) {
214 // g_warning("Failed to convert filename: %s: %s", file->path,
215 // error->message); g_error_free(error); return;
216 // }
217
218 GStatBuf statbuf;
219
220 if (g_lstat(file->path, &statbuf) == 0) {
221 file->time = get_time(&statbuf);
222 } else {
223 g_warning("Failed to stat file: %s, %s", file->path, strerror(errno));
224 }
225
226 // g_free(path);
227}
228
229static void set_collate_key(FBFile *file) {
230 file->collate_key = g_utf8_collate_key_for_filename(file->name, -1);
231}
232
234 if ((pd->array_length + 1) > pd->array_length_real) {
235 pd->array_length_real += 256;
236 pd->array =
237 g_realloc(pd->array, (pd->array_length_real + 1) * sizeof(FBFile));
238 }
239}
240
241static void get_file_browser(Mode *sw) {
248 char *cdir = g_file_get_path(pd->current_dir);
249 DIR *dir = opendir(cdir);
250 if (dir) {
251 struct dirent *rd = NULL;
252 while ((rd = readdir(dir)) != NULL) {
253 if (g_strcmp0(rd->d_name, "..") == 0) {
254 fb_resize_array(pd);
255 // Rofi expects utf-8, so lets convert the filename.
256 pd->array[pd->array_length].name = g_strdup("..");
257 pd->array[pd->array_length].path = NULL;
258 pd->array[pd->array_length].type = UP;
259 pd->array[pd->array_length].icon_fetch_uid = 0;
262 pd->array[pd->array_length].link = FALSE;
263 pd->array[pd->array_length].time = -1;
264 pd->array[pd->array_length].collate_key = NULL;
265 pd->array_length++;
266 continue;
267 }
268 if (g_strcmp0(rd->d_name, ".") == 0) {
269 continue;
270 }
271 if (rd->d_name[0] == '.' && file_browser_config.show_hidden == FALSE) {
272 continue;
273 }
274
275 switch (rd->d_type) {
276 case DT_BLK:
277 case DT_CHR:
278 case DT_FIFO:
279 case DT_UNKNOWN:
280 case DT_SOCK:
281 default:
282 break;
283 case DT_REG:
284 case DT_DIR:
285 fb_resize_array(pd);
286 // Rofi expects utf-8, so lets convert the filename.
287 pd->array[pd->array_length].name =
288 g_filename_to_utf8(rd->d_name, -1, NULL, NULL, NULL);
289 if (pd->array[pd->array_length].name == NULL) {
290 pd->array[pd->array_length].name = rofi_force_utf8(rd->d_name, -1);
291 }
292 pd->array[pd->array_length].path =
293 g_build_filename(cdir, rd->d_name, NULL);
294 pd->array[pd->array_length].type =
295 (rd->d_type == DT_DIR) ? DIRECTORY : RFILE;
296 pd->array[pd->array_length].icon_fetch_uid = 0;
299 pd->array[pd->array_length].link = FALSE;
300
301 if (file_browser_config.sorting_method == FB_SORT_NAME) {
303 } else if (file_browser_config.sorting_method == FB_SORT_TIME) {
304 set_time(&pd->array[pd->array_length]);
305 }
306
307 pd->array_length++;
308 break;
309 case DT_LNK:
310 fb_resize_array(pd);
311 // Rofi expects utf-8, so lets convert the filename.
312 pd->array[pd->array_length].name =
313 g_filename_to_utf8(rd->d_name, -1, NULL, NULL, NULL);
314 if (pd->array[pd->array_length].name == NULL) {
315 pd->array[pd->array_length].name = rofi_force_utf8(rd->d_name, -1);
316 }
317 pd->array[pd->array_length].path =
318 g_build_filename(cdir, rd->d_name, NULL);
319 pd->array[pd->array_length].icon_fetch_uid = 0;
322 pd->array[pd->array_length].link = TRUE;
323 // Default to file.
324 pd->array[pd->array_length].type = RFILE;
325
326 if (file_browser_config.sorting_method == FB_SORT_NAME) {
328 }
329
330 {
331 // If we have link, use a stat to fine out what it is, if we fail, we
332 // mark it as file.
333 // TODO have a 'broken link' mode?
334 // Convert full path to right encoding.
335 // DD: Path should be in file encoding, not utf-8
336 // char *file =
337 // g_filename_from_utf8(pd->array[pd->array_length].path,
338 // -1, NULL, NULL, NULL);
339 if (pd->array[pd->array_length].path) {
340 GStatBuf statbuf;
341 if (g_stat(pd->array[pd->array_length].path, &statbuf) == 0) {
342 if (S_ISDIR(statbuf.st_mode)) {
343 pd->array[pd->array_length].type = DIRECTORY;
344 } else if (S_ISREG(statbuf.st_mode)) {
345 pd->array[pd->array_length].type = RFILE;
346 }
347
348 if (file_browser_config.sorting_method == FB_SORT_TIME) {
349 pd->array[pd->array_length].time = get_time(&statbuf);
350 }
351 } else {
352 g_warning("Failed to stat file: %s, %s",
353 pd->array[pd->array_length].path, strerror(errno));
354 }
355
356 // g_free(file);
357 }
358 }
359 pd->array_length++;
360 break;
361 }
362 }
363 closedir(dir);
364 }
365 g_free(cdir);
366 g_qsort_with_data(pd->array, pd->array_length, sizeof(FBFile), compare, NULL);
367}
368
372 char *msg = NULL;
373 gboolean found_error = FALSE;
374
375 ThemeWidget *wid = rofi_config_find_widget(sw->name, NULL, TRUE);
376
377 Property *p = rofi_theme_find_property(wid, P_STRING, "sorting-method", TRUE);
378 if (p != NULL && p->type == P_STRING) {
379 if (g_strcmp0(p->value.s, "name") == 0) {
380 file_browser_config.sorting_method = FB_SORT_NAME;
381 } else if (g_strcmp0(p->value.s, "mtime") == 0) {
382 file_browser_config.sorting_method = FB_SORT_TIME;
383 file_browser_config.sorting_time = FB_MTIME;
384 } else if (g_strcmp0(p->value.s, "atime") == 0) {
385 file_browser_config.sorting_method = FB_SORT_TIME;
386 file_browser_config.sorting_time = FB_ATIME;
387 } else if (g_strcmp0(p->value.s, "ctime") == 0) {
388 file_browser_config.sorting_method = FB_SORT_TIME;
389 file_browser_config.sorting_time = FB_CTIME;
390 } else {
391 found_error = TRUE;
392
393 msg = g_strdup_printf("\"%s\" is not a valid filebrowser sorting method",
394 p->value.s);
395 }
396 }
397
398 p = rofi_theme_find_property(wid, P_BOOLEAN, "directories-first", TRUE);
399 if (p != NULL && p->type == P_BOOLEAN) {
400 file_browser_config.directories_first = p->value.b;
401 }
402
403 p = rofi_theme_find_property(wid, P_BOOLEAN, "show-hidden", TRUE);
404 if (p != NULL && p->type == P_BOOLEAN) {
405 file_browser_config.show_hidden = p->value.b;
406 }
407
408 p = rofi_theme_find_property(wid, P_STRING, "command", TRUE);
409 if (p != NULL && p->type == P_STRING) {
410 pd->command = g_strdup(p->value.s);
411 } else {
412 pd->command = g_strdup(DEFAULT_OPEN);
413 }
414
415 if (found_error) {
416 rofi_view_error_dialog(msg, FALSE);
417
418 g_free(msg);
419 }
420}
421
425
426 ThemeWidget *wid = rofi_config_find_widget(sw->name, NULL, TRUE);
427
428 Property *p = rofi_theme_find_property(wid, P_STRING, "directory", TRUE);
429
430 gboolean config_has_valid_dir = p != NULL && p->type == P_STRING &&
431 g_file_test(p->value.s, G_FILE_TEST_IS_DIR);
432
433 if (config_has_valid_dir) {
434 pd->current_dir = g_file_new_for_path(p->value.s);
435 } else {
436 char *current_dir = NULL;
437 char *cache_file =
438 g_build_filename(cache_dir, FILEBROWSER_CACHE_FILE, NULL);
439
440 if (g_file_get_contents(cache_file, &current_dir, NULL, NULL)) {
441 if (g_file_test(current_dir, G_FILE_TEST_IS_DIR)) {
442 pd->current_dir = g_file_new_for_path(current_dir);
443 }
444
445 g_free(current_dir);
446 }
447
448 // Store it based on the unique identifiers (desktop_id).
449 g_free(cache_file);
450 }
451
452 if (pd->current_dir == NULL) {
453 pd->current_dir = g_file_new_for_path(g_get_home_dir());
454 }
455}
456
461 if (mode_get_private_data(sw) == NULL) {
462 FileBrowserModePrivateData *pd = g_malloc0(sizeof(*pd));
463 mode_set_private_data(sw, (void *)pd);
464
467
468 // Load content.
470 }
471 return TRUE;
472}
473static unsigned int file_browser_mode_get_num_entries(const Mode *sw) {
476 return pd->array_length;
477}
478
479static ModeMode file_browser_mode_result(Mode *sw, int mretv, char **input,
480 unsigned int selected_line) {
481 ModeMode retv = MODE_EXIT;
484
485 if ((mretv & MENU_CANCEL) == MENU_CANCEL) {
486 ThemeWidget *wid = rofi_config_find_widget(sw->name, NULL, TRUE);
487 Property *p =
488 rofi_theme_find_property(wid, P_BOOLEAN, "cancel-returns-1", TRUE);
489 if (p && p->type == P_BOOLEAN && p->value.b == TRUE) {
491 }
492 return MODE_EXIT;
493 }
494 gboolean special_command =
496 if (mretv & MENU_CUSTOM_COMMAND) {
497 retv = (mretv & MENU_LOWER_MASK);
498 } else if ((mretv & MENU_OK)) {
499 if (selected_line < pd->array_length) {
500 if (pd->array[selected_line].type == UP) {
501 GFile *new = g_file_get_parent(pd->current_dir);
502 if (new) {
503 g_object_unref(pd->current_dir);
504 pd->current_dir = new;
505 free_list(pd);
507 return RESET_DIALOG;
508 }
509 } else if ((pd->array[selected_line].type == RFILE) ||
510 (pd->array[selected_line].type == DIRECTORY &&
511 special_command)) {
512 char *d_esc = g_shell_quote(pd->array[selected_line].path);
513 char *cmd = g_strdup_printf("%s %s", pd->command, d_esc);
514 g_free(d_esc);
515 char *cdir = g_file_get_path(pd->current_dir);
516 helper_execute_command(cdir, cmd, FALSE, NULL);
517 g_free(cdir);
518 g_free(cmd);
519 return MODE_EXIT;
520 } else if (pd->array[selected_line].type == DIRECTORY) {
521 char *path = g_build_filename(cache_dir, FILEBROWSER_CACHE_FILE, NULL);
522 g_file_set_contents(path, pd->array[selected_line].path, -1, NULL);
523 g_free(path);
524 GFile *new = g_file_new_for_path(pd->array[selected_line].path);
525 g_object_unref(pd->current_dir);
526 pd->current_dir = new;
527 free_list(pd);
529 return RESET_DIALOG;
530 }
531 }
532 retv = RELOAD_DIALOG;
533 } else if ((mretv & MENU_CUSTOM_INPUT)) {
534 if (special_command) {
535 GFile *new = g_file_get_parent(pd->current_dir);
536 if (new) {
537 g_object_unref(pd->current_dir);
538 pd->current_dir = new;
539 free_list(pd);
541 }
542 return RESET_DIALOG;
543 }
544 if (*input) {
545 char *p = rofi_expand_path(*input);
546 char *dir = g_filename_from_utf8(p, -1, NULL, NULL, NULL);
547 g_free(p);
548 if (g_file_test(dir, G_FILE_TEST_EXISTS)) {
549 if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
550 g_object_unref(pd->current_dir);
551 pd->current_dir = g_file_new_for_path(dir);
552 g_free(dir);
553 free_list(pd);
555 return RESET_DIALOG;
556 }
557 }
558 g_free(dir);
559 retv = RELOAD_DIALOG;
560 }
561 } else if ((mretv & MENU_ENTRY_DELETE) == MENU_ENTRY_DELETE) {
562 file_browser_config.show_hidden = !file_browser_config.show_hidden;
563 free_list(pd);
565 retv = RELOAD_DIALOG;
566 }
567 return retv;
568}
569
573 if (pd != NULL) {
574 g_object_unref(pd->current_dir);
575 g_free(pd->command);
576 free_list(pd);
577 g_free(pd);
578 mode_set_private_data(sw, NULL);
579 }
580}
581
582static char *_get_display_value(const Mode *sw, unsigned int selected_line,
583 G_GNUC_UNUSED int *state,
584 G_GNUC_UNUSED GList **attr_list,
585 int get_entry) {
588
589 // Only return the string if requested, otherwise only set state.
590 if (!get_entry) {
591 return NULL;
592 }
593 if (pd->array[selected_line].type == UP) {
594 return g_strdup(" ..");
595 }
596 if (pd->array[selected_line].link) {
597 return g_strconcat("@", pd->array[selected_line].name, NULL);
598 }
599 return g_strdup(pd->array[selected_line].name);
600}
601
611static int file_browser_token_match(const Mode *sw, rofi_int_matcher **tokens,
612 unsigned int index) {
615
616 // Call default matching function.
617 return helper_token_match(tokens, pd->array[index].name);
618}
619
620static cairo_surface_t *_get_icon(const Mode *sw, unsigned int selected_line,
621 unsigned int height) {
624 const guint scale = display_scale();
625 g_return_val_if_fail(pd->array != NULL, NULL);
626 FBFile *dr = &(pd->array[selected_line]);
629 } else if (dr->type == RFILE) {
630 gchar* _path = g_strconcat("thumbnail://", dr->path, NULL);
631 dr->icon_fetch_uid = rofi_icon_fetcher_query(_path, height);
632 g_free(_path);
633 } else {
635 }
636 dr->icon_fetch_size = height;
637 dr->icon_fetch_scale = scale;
639}
640
641static char *_get_message(const Mode *sw) {
644 if (pd->current_dir) {
645 char *dirname = g_file_get_parse_name(pd->current_dir);
646 char *str =
647 g_markup_printf_escaped("<b>Current directory:</b> %s", dirname);
648 g_free(dirname);
649 return str;
650 }
651 return "n/a";
652}
653
654static char *_get_completion(const Mode *sw, unsigned int index) {
657
658 char *d = g_strescape(pd->array[index].path, NULL);
659 return d;
660}
661
663 Mode *sw = g_malloc0(sizeof(Mode));
664
665 *sw = file_browser_mode;
666
667 sw->private_data = NULL;
668 return sw;
669}
670
671#if 1
672ModeMode file_browser_mode_completer(Mode *sw, int mretv, char **input,
673 unsigned int selected_line, char **path) {
674 ModeMode retv = MODE_EXIT;
677 if ((mretv & MENU_OK)) {
678 if (selected_line < pd->array_length) {
679 if (pd->array[selected_line].type == UP) {
680 GFile *new = g_file_get_parent(pd->current_dir);
681 if (new) {
682 g_object_unref(pd->current_dir);
683 pd->current_dir = new;
684 free_list(pd);
686 return RESET_DIALOG;
687 }
688 } else if (pd->array[selected_line].type == DIRECTORY) {
689 GFile *new = g_file_new_for_path(pd->array[selected_line].path);
690 g_object_unref(pd->current_dir);
691 pd->current_dir = new;
692 free_list(pd);
694 return RESET_DIALOG;
695 } else if (pd->array[selected_line].type == RFILE) {
696 *path = g_strescape(pd->array[selected_line].path, NULL);
697 return MODE_EXIT;
698 }
699 }
700 retv = RELOAD_DIALOG;
701 } else if ((mretv & MENU_CUSTOM_INPUT) && *input) {
702 char *p = rofi_expand_path(*input);
703 char *dir = g_filename_from_utf8(p, -1, NULL, NULL, NULL);
704 g_free(p);
705 if (g_file_test(dir, G_FILE_TEST_EXISTS)) {
706 if (g_file_test(dir, G_FILE_TEST_IS_DIR)) {
707 g_object_unref(pd->current_dir);
708 pd->current_dir = g_file_new_for_path(dir);
709 g_free(dir);
710 free_list(pd);
712 return RESET_DIALOG;
713 }
714 }
715 g_free(dir);
716 retv = RELOAD_DIALOG;
717 } else if ((mretv & MENU_ENTRY_DELETE) == MENU_ENTRY_DELETE) {
718 file_browser_config.show_hidden = !file_browser_config.show_hidden;
719 free_list(pd);
721 retv = RELOAD_DIALOG;
722 }
723 return retv;
724}
725#endif
726
727Mode file_browser_mode = {.display_name = NULL,
728 .abi_version = ABI_VERSION,
729 .name = "filebrowser",
730 .cfg_name_key = "display-filebrowser",
731 ._init = file_browser_mode_init,
732 ._get_num_entries = file_browser_mode_get_num_entries,
733 ._result = file_browser_mode_result,
734 ._destroy = file_browser_mode_destroy,
735 ._token_match = file_browser_token_match,
736 ._get_display_value = _get_display_value,
737 ._get_icon = _get_icon,
738 ._get_message = _get_message,
739 ._get_completion = _get_completion,
740 ._preprocess_input = NULL,
741 ._create = create_new_file_browser,
742 ._completer_result = file_browser_mode_completer,
743 .private_data = NULL,
744 .free = NULL,
guint display_scale(void)
Definition display.c:78
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)
struct @350155374321315310233337240142041243372357074132 file_browser_config
static char * _get_completion(const Mode *sw, unsigned int index)
static unsigned int file_browser_mode_get_num_entries(const Mode *sw)
static void set_collate_key(FBFile *file)
FBFileType
Definition filebrowser.c:66
@ NUM_FILE_TYPES
Definition filebrowser.c:70
@ DIRECTORY
Definition filebrowser.c:68
@ UP
Definition filebrowser.c:67
@ RFILE
Definition filebrowser.c:69
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:53
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:76
@ FB_SORT_NAME
Definition filebrowser.c:77
@ FB_SORT_TIME
Definition filebrowser.c:78
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:84
@ FB_CTIME
Definition filebrowser.c:87
@ FB_MTIME
Definition filebrowser.c:85
@ FB_ATIME
Definition filebrowser.c:86
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:91
#define DEFAULT_OPEN
Definition filebrowser.c:55
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:745
gboolean helper_execute_command(const char *wd, const char *cmd, gboolean run_in_term, RofiHelperExecuteContext *context)
Definition helper.c:1457
ThemeWidget * rofi_config_find_widget(const char *name, const char *state, gboolean exact)
Definition theme.c:782
char * rofi_expand_path(const char *input)
Definition helper.c:784
int helper_token_match(rofi_int_matcher *const *tokens, const char *input)
Definition helper.c:541
char * rofi_force_utf8(const gchar *data, ssize_t length)
Definition helper.c:862
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:49
void * mode_get_private_data(const Mode *mode)
Definition mode.c:176
void mode_set_private_data(Mode *mode, void *pd)
Definition mode.c:181
ModeMode
Definition mode.h:54
@ MENU_CUSTOM_COMMAND
Definition mode.h:84
@ MENU_LOWER_MASK
Definition mode.h:92
@ MENU_CANCEL
Definition mode.h:74
@ MENU_ENTRY_DELETE
Definition mode.h:80
@ MENU_CUSTOM_ACTION
Definition mode.h:90
@ MENU_OK
Definition mode.h:72
@ MENU_CUSTOM_INPUT
Definition mode.h:78
@ MODE_EXIT
Definition mode.h:56
@ RELOAD_DIALOG
Definition mode.h:60
@ RESET_DIALOG
Definition mode.h:64
void rofi_set_return_code(int code)
Definition rofi.c:155
const char * cache_dir
Definition rofi.c:86
int rofi_view_error_dialog(const char *msg, int markup)
Definition view.c:1980
@ MODE_TYPE_COMPLETER
@ MODE_TYPE_SWITCHER
#define ABI_VERSION
Definition mode.h:36
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:94
guint icon_fetch_scale
Definition filebrowser.c:98
enum FBFileType type
Definition filebrowser.c:95
gboolean link
Definition filebrowser.c:99
char * collate_key
uint32_t icon_fetch_size
Definition filebrowser.c:97
char * name
Definition filebrowser.c:93
uint32_t icon_fetch_uid
Definition filebrowser.c:96
time_t time
PropertyValue value
Definition rofi-types.h:293
PropertyType type
Definition rofi-types.h:291
char * name
void * private_data