mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
596da965cf
4
Makefile
4
Makefile
|
@ -1,4 +1,4 @@
|
|||
VERSION = 0.5
|
||||
VERSION = 0.6
|
||||
|
||||
PREFIX = /usr/local
|
||||
MANPREFIX = $(PREFIX)/man
|
||||
|
@ -16,7 +16,7 @@ BIN = noice
|
|||
all: $(BIN)
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LDLIBS)
|
||||
$(CC) $(CFLAGS) -o $@ $(OBJ) $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
noice.o: util.h config.h
|
||||
strlcat.o: util.h
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
/* See LICENSE file for copyright and license details. */
|
||||
#define CWD "cwd: "
|
||||
#define CWD "cwd: "
|
||||
#define CURSR " > "
|
||||
#define EMPTY " "
|
||||
|
||||
int mtimeorder = 0; /* Set to 1 to sort by time modified */
|
||||
int mtimeorder = 0; /* Set to 1 to sort by time modified */
|
||||
int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
|
||||
char *idlecmd = "rain"; /* The screensaver program */
|
||||
int showhidden = 0; /* Set to 1 to show hidden files by default */
|
||||
char *idlecmd = "rain"; /* The screensaver program */
|
||||
|
||||
struct assoc assocs[] = {
|
||||
//{ "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", "mpv" },
|
||||
|
|
18
noice.c
18
noice.c
|
@ -256,6 +256,12 @@ setfilter(regex_t *regex, char *filter)
|
|||
return r;
|
||||
}
|
||||
|
||||
void
|
||||
initfilter(int dot, char **ifilter)
|
||||
{
|
||||
*ifilter = dot ? "." : "^[^.]";
|
||||
}
|
||||
|
||||
int
|
||||
visible(regex_t *regex, char *file)
|
||||
{
|
||||
|
@ -793,10 +799,9 @@ nochange:
|
|||
DPRINTF_S(path);
|
||||
goto begin;
|
||||
case SEL_TOGGLEDOT:
|
||||
if (strcmp(fltr, ifilter) != 0)
|
||||
strlcpy(fltr, ifilter, sizeof(fltr));
|
||||
else
|
||||
strlcpy(fltr, ".", sizeof(fltr));
|
||||
showhidden ^= 1;
|
||||
initfilter(showhidden, &ifilter);
|
||||
strlcpy(fltr, ifilter, sizeof(fltr));
|
||||
goto begin;
|
||||
case SEL_MTIME:
|
||||
mtimeorder = !mtimeorder;
|
||||
|
@ -855,9 +860,8 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
if (getuid() == 0)
|
||||
ifilter = ".";
|
||||
else
|
||||
ifilter = "^[^.]"; /* Hide dotfiles */
|
||||
showhidden = 1;
|
||||
initfilter(showhidden, &ifilter);
|
||||
|
||||
if (argv[1] != NULL) {
|
||||
ipath = argv[1];
|
||||
|
|
Loading…
Reference in a new issue