Przeglądaj źródła

Support screen locking on Linux

master
Arun Prakash Jana 7 lat temu
rodzic
commit
3a515585d1
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: A75979F35C080412
4 zmienionych plików z 20 dodań i 2 usunięć
  1. +1
    -0
      README.md
  2. +2
    -0
      nnn.1
  3. +8
    -0
      nnn.c
  4. +9
    -2
      nnn.h

+ 1
- 0
README.md Wyświetl plik

@@ -242,6 +242,7 @@ optional arguments:
^Y | Toggle multi-copy mode
^T | Toggle path quote
^L | Redraw, clear prompt
L | Lock terminal (on Linux)
? | Help, settings
Q, ^G | Quit and cd
q, ^X | Quit


+ 2
- 0
nnn.1 Wyświetl plik

@@ -112,6 +112,8 @@ Toggle multiple file path copy mode
Toggle path quote
.It Ic ^L
Force a redraw, clear rename or filter prompt
.It Ic L
Lock terminal (Linux only)
.It Ic \&?
Toggle help and settings screen
.It Ic Q, ^G


+ 8
- 0
nnn.c Wyświetl plik

@@ -1968,6 +1968,9 @@ show_help(char *path)
"d^Y | Toggle multi-copy mode\n"
"d^T | Toggle path quote\n"
"d^L | Redraw, clear prompt\n"
#ifdef __linux__
"eL | Lock terminal\n"
#endif
"e? | Help, settings\n"
"aQ, ^G | Quit and cd\n"
"aq, ^X | Quit\n\n");
@@ -3208,6 +3211,11 @@ nochange:
run = xgetenv(env, run);
spawn(run, dents[cur].name, NULL, path, F_NORMAL);
break;
#ifdef __linux__
case SEL_LOCK:
spawn(player, "", "screensaver", NULL, F_NORMAL | F_SIGINT);
break;
#endif
case SEL_CDQUIT:
{
char *tmpfile = "/tmp/nnn";


+ 9
- 2
nnn.h Wyświetl plik

@@ -44,6 +44,9 @@ enum action {
SEL_RUN,
SEL_RUNSCRIPT,
SEL_RUNARG,
#ifdef __linux__
SEL_LOCK,
#endif
SEL_CDQUIT,
SEL_QUIT,
};
@@ -135,9 +138,9 @@ static struct key bindings[] = {
/* Open dir in desktop file manager */
{ 'o', SEL_DFB, "", "" },
/* List archive */
{ 'F', SEL_LIST, "-l", "" },
{ 'F', SEL_LIST, "-l", "" },
/* Extract archive */
{ CONTROL('F'), SEL_EXTRACT, "-x", "" },
{ CONTROL('F'), SEL_EXTRACT, "-x", "" },
/* Toggle sort by size */
{ 's', SEL_FSIZE, "", "" },
/* Sort by total block count including dir contents */
@@ -173,6 +176,10 @@ static struct key bindings[] = {
/* Run command with argument */
{ 'e', SEL_RUNARG, "vi", "EDITOR" },
{ 'p', SEL_RUNARG, "less", "PAGER" },
#ifdef __linux__
/* Lock screen */
{ 'L', SEL_LOCK, "", "" },
#endif
/* Change dir on quit */
{ 'Q', SEL_CDQUIT, "", "" },
{ CONTROL('G'), SEL_CDQUIT, "", "" },


Ładowanie…
Anuluj
Zapisz