mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 03:41:27 +00:00
make option NOX11: disable notis, sel to clipboard sync, xterm title
This commit is contained in:
parent
2b94c29e1d
commit
25157592df
5
Makefile
5
Makefile
|
@ -26,6 +26,7 @@ O_BENCH := 0 # benchmark mode (stops at first user input)
|
|||
O_NOSSN := 0 # enable session support
|
||||
O_NOUG := 0 # disable user, group name in status bar
|
||||
O_CKBOARD := 0 # use checker board (stipple) in detail mode
|
||||
O_NOX11 := 0 # disable X11 integration
|
||||
|
||||
# convert targets to flags for backwards compatibility
|
||||
ifneq ($(filter debug,$(MAKECMDGOALS)),)
|
||||
|
@ -105,6 +106,10 @@ ifeq ($(strip $(O_CKBOARD)),1)
|
|||
CPPFLAGS += -DCKBOARD
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(O_NOX11)),1)
|
||||
CPPFLAGS += -DNOX11
|
||||
endif
|
||||
|
||||
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
|
||||
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
|
||||
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
|
||||
|
|
|
@ -24,6 +24,7 @@ O_BENCH := 0 # benchmark mode (stops at first user input)
|
|||
O_NOSSN := 0 # enable session support
|
||||
O_NOUG := 0 # disable user, group name in status bar
|
||||
O_CKBOARD := 0 # use checker board (stipple) in detail mode
|
||||
O_NOX11 := 0 # disable X11 integration
|
||||
|
||||
# convert targets to flags for backwards compatibility
|
||||
ifneq ($(filter debug,$(MAKECMDGOALS)),)
|
||||
|
@ -104,6 +105,10 @@ ifeq ($(strip $(O_CKBOARD)),1)
|
|||
CPPFLAGS += -DCKBOARD
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(O_NOX11)),1)
|
||||
CPPFLAGS += -DNOX11
|
||||
endif
|
||||
|
||||
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
|
||||
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
|
||||
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
|
||||
|
|
16
src/nnn.c
16
src/nnn.c
|
@ -5914,6 +5914,7 @@ begin:
|
|||
setdirwatch();
|
||||
}
|
||||
|
||||
#ifndef NOX11
|
||||
if (cfg.x11) {
|
||||
/* Set terminal window title */
|
||||
r = set_tilde_in_path(path);
|
||||
|
@ -5924,6 +5925,7 @@ begin:
|
|||
if (r)
|
||||
reset_tilde_in_path(path);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g_state.selmode && lastdir[0])
|
||||
lastappendpos = selbufpos;
|
||||
|
@ -6579,8 +6581,10 @@ nochange:
|
|||
writesel(NULL, 0);
|
||||
}
|
||||
|
||||
#ifndef NOX11
|
||||
if (cfg.x11)
|
||||
plugscript(utils[UTIL_CBCP], F_NOWAIT | F_NOTRACE);
|
||||
#endif
|
||||
|
||||
if (!nselected)
|
||||
unlink(selpath);
|
||||
|
@ -6673,8 +6677,10 @@ nochange:
|
|||
writesel(pselbuf, selbufpos - 1); /* Truncate NULL from end */
|
||||
}
|
||||
|
||||
#ifndef NOX11
|
||||
if (cfg.x11)
|
||||
plugscript(utils[UTIL_CBCP], F_NOWAIT | F_NOTRACE);
|
||||
#endif
|
||||
continue;
|
||||
case SEL_SELEDIT:
|
||||
r = editselection();
|
||||
|
@ -6682,8 +6688,10 @@ nochange:
|
|||
r = !r ? MSG_0_SELECTED : MSG_FAILED;
|
||||
printwait(messages[r], &presel);
|
||||
} else {
|
||||
#ifndef NOX11
|
||||
if (cfg.x11)
|
||||
plugscript(utils[UTIL_CBCP], F_NOWAIT | F_NOTRACE);
|
||||
#endif
|
||||
cfg.filtermode ? presel = FILTER : statusbar(path);
|
||||
}
|
||||
goto nochange;
|
||||
|
@ -6730,9 +6738,11 @@ nochange:
|
|||
presel = FILTER;
|
||||
clearfilter();
|
||||
|
||||
#ifndef NOX11
|
||||
/* Show notification on operation complete */
|
||||
if (cfg.x11)
|
||||
plugscript(utils[UTIL_NTFY], F_NOWAIT | F_NOTRACE);
|
||||
#endif
|
||||
|
||||
if (newpath[0] && !access(newpath, F_OK))
|
||||
xstrsncpy(lastname, xbasename(newpath), NAME_MAX+1);
|
||||
|
@ -7405,7 +7415,9 @@ static void usage(void)
|
|||
#endif
|
||||
" -V show version\n"
|
||||
" -w place HW cursor on hovered\n"
|
||||
#ifndef NOX11
|
||||
" -x notis, sel to clipboard, xterm title\n"
|
||||
#endif
|
||||
" -h show help\n\n"
|
||||
"v%s\n%s\n", __func__, VERSION, GENERAL_INFO);
|
||||
}
|
||||
|
@ -7512,10 +7524,12 @@ static bool set_tmp_path(void)
|
|||
|
||||
static void cleanup(void)
|
||||
{
|
||||
#ifndef NOX11
|
||||
if (cfg.x11) {
|
||||
printf("\033[23;0t"); /* reset terminal window title */
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
free(selpath);
|
||||
free(plgpath);
|
||||
free(cfgpath);
|
||||
|
@ -7931,11 +7945,13 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef NOX11
|
||||
if (cfg.x11) {
|
||||
/* Save terminal window title */
|
||||
printf("\033[22;0t");
|
||||
fflush(stdout);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NOMOUSE
|
||||
if (!initcurses(&mask))
|
||||
|
|
Loading…
Reference in a new issue