diff --git a/i3lock.1 b/i3lock.1 index 55af52d..454cc8f 100644 --- a/i3lock.1 +++ b/i3lock.1 @@ -105,6 +105,16 @@ your computer with the enter key. .B \-f, \-\-show-failed-attempts Show the number of failed attempts, if any. +.TP +.BI \-x\ command \fR,\ \fB\-\-max\-failed\-attempts\-exec= command +Run a command, when the the maximum ammount of failed authentication +attempts (default 3; can be specified with \-m) is exceeded. + +.TP +.BI \-m\ count \fR,\ \fB\-\-max\-failed\-attempts= count +Set the maximum ammount of failed authentication attempts. +Without \-x it will be useless. + .TP .B \-\-debug Enables debug logging. diff --git a/i3lock.c b/i3lock.c index 726dff4..71ebf05 100644 --- a/i3lock.c +++ b/i3lock.c @@ -82,9 +82,9 @@ extern auth_state_t auth_state; int failed_attempts = 0; bool show_failed_attempts = false; bool retry_verification = false; -int max_failed_attempts = 3; -bool max_failed_attempts_enabled = false; -char *max_failed_attempts_exec; +static int max_failed_attempts = 3; +static bool max_failed_attempts_enabled = false; +static char *max_failed_attempts_exec; static struct xkb_state *xkb_state; static struct xkb_context *xkb_context; @@ -376,6 +376,7 @@ static void input_done(void) { system(max_failed_attempts_exec); exit(EXIT_SUCCESS); } + max_failed_attempts_enabled = false; } }