Browse Source

Add option to set custom 'no input' text

master
qikiqi 7 years ago
parent
commit
7787456845
  1. 4
      i3lock.1
  2. 5
      i3lock.c
  3. 3
      unlock_indicator.c

4
i3lock.1

@ -304,6 +304,10 @@ Sets the string to be shown while verifying the password/input/key/etc. Defaults
.B \-\-wrongtext="text" .B \-\-wrongtext="text"
Sets the string to be shown upon entering an incorrect password. Defaults to "wrong!". Sets the string to be shown upon entering an incorrect password. Defaults to "wrong!".
.TP
.B \-\-noinputtext="text"
Sets the string to be shown upon pressing backspace without anything to delete. Defaults to "no input".
.TP .TP
.B \-\-radius .B \-\-radius
The radius of the circle. Defaults to 90. The radius of the circle. Defaults to 90.

5
i3lock.c

@ -154,6 +154,7 @@ double ring_width = 7.0;
char* verif_text = "verifying…"; char* verif_text = "verifying…";
char* wrong_text = "wrong!"; char* wrong_text = "wrong!";
char* noinput_text = "no input";
int keylayout_mode = -1; int keylayout_mode = -1;
char* layout_text = NULL; char* layout_text = NULL;
@ -1130,6 +1131,7 @@ int main(int argc, char *argv[]) {
{"veriftext", required_argument, NULL, 0}, {"veriftext", required_argument, NULL, 0},
{"wrongtext", required_argument, NULL, 0}, {"wrongtext", required_argument, NULL, 0},
{"noinputtext", required_argument, NULL, 0},
{"modsize", required_argument, NULL, 0}, {"modsize", required_argument, NULL, 0},
{"radius", required_argument, NULL, 0}, {"radius", required_argument, NULL, 0},
{"ring-width", required_argument, NULL, 0}, {"ring-width", required_argument, NULL, 0},
@ -1546,6 +1548,9 @@ int main(int argc, char *argv[]) {
else if (strcmp(longopts[longoptind].name, "wrongtext") == 0) { else if (strcmp(longopts[longoptind].name, "wrongtext") == 0) {
wrong_text = optarg; wrong_text = optarg;
} }
else if (strcmp(longopts[longoptind].name, "noinputtext") == 0) {
noinput_text = optarg;
}
else if (strcmp(longopts[longoptind].name, "verifsize") == 0) { else if (strcmp(longopts[longoptind].name, "verifsize") == 0) {
char *arg = optarg; char *arg = optarg;

3
unlock_indicator.c

@ -119,6 +119,7 @@ extern double layout_size;
extern char *verif_text; extern char *verif_text;
extern char *wrong_text; extern char *wrong_text;
extern char *noinput_text;
extern char *layout_text; extern char *layout_text;
/* Whether the failed attempts should be displayed. */ /* Whether the failed attempts should be displayed. */
@ -749,7 +750,7 @@ xcb_pixmap_t draw_image(uint32_t *resolution) {
default: default:
if (unlock_state == STATE_NOTHING_TO_DELETE) { if (unlock_state == STATE_NOTHING_TO_DELETE) {
draw_data.status_text.show = true; draw_data.status_text.show = true;
strncpy(draw_data.status_text.str, "no input", sizeof(draw_data.status_text.str)); strncpy(draw_data.status_text.str, noinput_text, sizeof(draw_data.status_text.str));
draw_data.status_text.font = get_font_face(WRONG_FONT); draw_data.status_text.font = get_font_face(WRONG_FONT);
draw_data.status_text.color = wrong16; draw_data.status_text.color = wrong16;
draw_data.status_text.size = wrong_size; draw_data.status_text.size = wrong_size;

Loading…
Cancel
Save