O_NOUG := 0 # disable user, group name in status bar
O_NOX11 := 0 # disable X11 integration
O_MATCHFLTR := 0 # allow filters without matches
-O_FILEINFO := 0 # show file informaiton in info line
# User patches
O_GITSTATUS := 0 # add git status to detail view
CPPFLAGS += -DMATCHFLTR
endif
-ifeq ($(strip $(O_FILEINFO)),1)
- CPPFLAGS += -DFILEINFO
-endif
-
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
/* The following settings are global */
uint_t curctx : 3; /* Current context number */
uint_t prefersel : 1; /* Prefer selection over current, if exists */
- uint_t reserved2 : 1;
+ uint_t fileinfo : 1; /* Show file information on hover */
uint_t nonavopen : 1; /* Open file on right arrow or `l` */
uint_t autoselect : 1; /* Auto-select dir in type-to-nav mode */
uint_t cursormode : 1; /* Move hardware cursor with selection */
uint_t useeditor : 1; /* Use VISUAL to open text files */
- uint_t reserved3 : 3;
+ uint_t reserved2 : 3;
uint_t regex : 1; /* Use regex filters */
uint_t x11 : 1; /* Copy to system clipboard, show notis, xterm title */
uint_t timetype : 2; /* Time sort type (0: access, 1: change, 2: modification) */
0, /* reserved1 */
0, /* curctx */
0, /* prefersel */
- 0, /* reserved2 */
+ 0, /* fileinfo */
0, /* nonavopen */
1, /* autoselect */
0, /* cursormode */
0, /* useeditor */
- 0, /* reserved3 */
+ 0, /* reserved2 */
0, /* regex */
0, /* x11 */
2, /* timetype (T_MOD) */
(cfg.regex ? "reg" : "str"),
((fnstrstr == &strcasestr) ? "ic" : "noic"));
-#ifdef FILEINFO
- if (ndents && get_output("file", "-b", pdents[cur].name, -1, FALSE, FALSE))
+ if (cfg.fileinfo && ndents && get_output("file", "-b", pdents[cur].name, -1, FALSE, FALSE))
mvaddstr(xlines - 2, 2, g_buf);
-#endif
+
mvaddstr(xlines - 2, xcols - xstrlen(info), info);
}
attron(COLOR_PAIR(cfg.curctx + 1));
-#ifdef FILEINFO
- if (get_output("file", "-b", pdents[cur].name, -1, FALSE, FALSE))
+ if (cfg.fileinfo && get_output("file", "-b", pdents[cur].name, -1, FALSE, FALSE))
mvaddstr(xlines - 2, 2, g_buf);
-#endif
tolastln();
}
#endif
if (S_ISLNK(pent->mode)) {
-#ifndef FILEINFO
- i = readlink(pent->name, g_buf, PATH_MAX);
- addstr(coolsize(i >= 0 ? i : pent->size)); /* Show symlink size */
- if (i > 1) { /* Show symlink target */
- int y;
-
- addstr(" ->");
- getyx(stdscr, len, y);
- i = MIN(i, xcols - y);
- g_buf[i] = '\0';
- addstr(g_buf);
+ if (!cfg.fileinfo) {
+ i = readlink(pent->name, g_buf, PATH_MAX);
+ addstr(coolsize(i >= 0 ? i : pent->size)); /* Show symlink size */
+ if (i > 1) { /* Show symlink target */
+ int y;
+
+ addstr(" ->");
+ getyx(stdscr, len, y);
+ i = MIN(i, xcols - y);
+ g_buf[i] = '\0';
+ addstr(g_buf);
+ }
}
-#endif
} else {
addstr(coolsize(pent->size));
addch(' ');
#endif
" -g regex filters\n"
" -H show hidden files\n"
+ " -i show file info on hover\n"
" -J no auto-proceed on select\n"
" -K detect key collision\n"
" -l val set scroll lines\n"
while ((opt = (env_opts_id > 0
? env_opts[--env_opts_id]
- : getopt(argc, argv, "aAb:cCdDeEfF:gHJKl:nop:P:QrRs:St:T:uUVwxh"))) != -1) {
+ : getopt(argc, argv, "aAb:cCdDeEfF:gHiJKl:nop:P:QrRs:St:T:uUVwxh"))) != -1) {
switch (opt) {
#ifndef NOFIFO
case 'a':
case 'H':
cfg.showhidden = 1;
break;
+ case 'i':
+ cfg.fileinfo = 1;
+ break;
case 'J':
g_state.stayonsel = 1;
break;