瀏覽代碼

Use pipes.sh as fallback user lock

master
Arun Prakash Jana 5 年之前
父節點
當前提交
7f8766247f
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A75979F35C080412
共有 1 個檔案被更改,包括 15 行新增8 行删除
  1. +15
    -8
      src/nnn.c

+ 15
- 8
src/nnn.c 查看文件

@@ -333,8 +333,9 @@ static char g_tmpfpath[TMP_LEN_MAX] __attribute__ ((aligned));
#define ATOOL 3 #define ATOOL 3
#define BSDTAR 4 #define BSDTAR 4
#define LOCKER 5 #define LOCKER 5
#define NLAUNCH 6 #define PIPES 6
#define UNKNOWN 7 #define NLAUNCH 7
#define UNKNOWN 8


/* Utilities to open files, run actions */ /* Utilities to open files, run actions */
static char * const utils[] = { static char * const utils[] = {
@@ -356,6 +357,7 @@ static char * const utils[] = {
#else #else
"vlock", "vlock",
#endif #endif
"pipes.sh",
"nlaunch", "nlaunch",
"UNKNOWN" "UNKNOWN"
}; };
@@ -2607,6 +2609,15 @@ static bool sshfs_unmount(char *path, char *newpath, int *presel)
return TRUE; return TRUE;
} }


static void lock_terminal(void)
{
char *tmp = utils[LOCKER];
if (!getutil(tmp))
tmp = utils[PIPES];;

spawn(tmp, NULL, NULL, NULL, F_NORMAL);
}

/* /*
* The help string tokens (each line) start with a HEX value * The help string tokens (each line) start with a HEX value
* which indicates the number of spaces to print before the * which indicates the number of spaces to print before the
@@ -3724,7 +3735,7 @@ nochange:
break; break;
} }
default: /* SEL_LOCK */ default: /* SEL_LOCK */
spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL); lock_terminal();
break; break;
} }


@@ -4252,11 +4263,7 @@ nochange:
/* Locker */ /* Locker */
if (idletimeout && idle == idletimeout) { if (idletimeout && idle == idletimeout) {
idle = 0; idle = 0;
tmp = utils[LOCKER]; lock_terminal();
if (!getutil(tmp))
tmp = "pipes.sh";

spawn(tmp, NULL, NULL, NULL, F_NORMAL);
if (ndents) if (ndents)
copycurname(); copycurname();
goto begin; goto begin;


||||||
x
 
000:0
Loading…
取消
儲存