mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2025-02-24 16:06:26 -05:00
Added support for setting status font
This commit is contained in:
parent
86678f2176
commit
2238cd20b9
3 changed files with 36 additions and 23 deletions
13
README.md
13
README.md
|
@ -52,12 +52,13 @@ Many little improvements have been made to i3lock over time:
|
|||
- `--datecolor=rrggbbaa` -- color of the date string
|
||||
- `--datefont="sans-serif"` -- font used for the date display
|
||||
- `--datesize=14` -- font size for the date display
|
||||
- `--veriftext="verifying…"` -- text to be shown while verifying
|
||||
- `--wrongtext="wrong!"` -- text to be shown upon an incorrect password being entered
|
||||
- `--textsize=28` -- font size for the status text
|
||||
- `--modsize=14` -- font size for the modifier keys listing
|
||||
- `--radius=90` -- the radius of the circle indicator
|
||||
- `--ring-width=7` -- the width of the indicator ring
|
||||
- `--veriftext="verifying…"` -- text to be shown while verifying
|
||||
- `--wrongtext="wrong!"` -- text to be shown upon an incorrect password being entered
|
||||
- `--statusfont="sans-serif"` -- font used for the status text
|
||||
- `--textsize=28` -- font size for the status text
|
||||
- `--modsize=14` -- font size for the modifier keys listing
|
||||
- `--radius=90` -- the radius of the circle indicator
|
||||
- `--ring-width=7` -- the width of the indicator ring
|
||||
|
||||
- You can specify whether i3lock should bell upon a wrong password.
|
||||
|
||||
|
|
10
i3lock.c
10
i3lock.c
|
@ -106,6 +106,7 @@ char time_format[32] = "%H:%M:%S\0";
|
|||
char date_format[32] = "%A, %m %Y\0";
|
||||
char time_font[32] = "sans-serif\0";
|
||||
char date_font[32] = "sans-serif\0";
|
||||
char status_font[32] = "sans-serif\0";
|
||||
char layout_font[32] = "sans-serif\0";
|
||||
char ind_x_expr[32] = "x + (w / 2)\0";
|
||||
char ind_y_expr[32] = "y + (h / 2)\0";
|
||||
|
@ -1038,6 +1039,7 @@ int main(int argc, char *argv[]) {
|
|||
{"keylayout", required_argument, NULL, 0},
|
||||
{"timefont", required_argument, NULL, 0},
|
||||
{"datefont", required_argument, NULL, 0},
|
||||
{"statusfont", required_argument, NULL, 0},
|
||||
{"layoutfont", required_argument, NULL, 0},
|
||||
{"timesize", required_argument, NULL, 0},
|
||||
{"datesize", required_argument, NULL, 0},
|
||||
|
@ -1324,6 +1326,14 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
strcpy(date_font,optarg);
|
||||
}
|
||||
else if (strcmp(longopts[longoptind].name, "statusfont") == 0) {
|
||||
//read in to status_font
|
||||
if (strlen(optarg) > 31) {
|
||||
errx(1, "status font string can be at most 31 "
|
||||
"characters\n");
|
||||
}
|
||||
strcpy(status_font,optarg);
|
||||
}
|
||||
else if (strcmp(longopts[longoptind].name, "timesize") == 0) {
|
||||
char *arg = optarg;
|
||||
|
||||
|
|
|
@ -96,6 +96,7 @@ extern char time_format[32];
|
|||
extern char date_format[32];
|
||||
extern char time_font[32];
|
||||
extern char date_font[32];
|
||||
extern char status_font[32];
|
||||
extern char layout_font[32];
|
||||
extern char ind_x_expr[32];
|
||||
extern char ind_y_expr[32];
|
||||
|
@ -397,7 +398,8 @@ xcb_pixmap_t draw_image(uint32_t *resolution) {
|
|||
char buf[4];
|
||||
|
||||
cairo_set_source_rgba(ctx, (double)text16->red/255, (double)text16->green/255, (double)text16->blue/255, (double)text16->alpha/255);
|
||||
cairo_select_font_face(ctx, "sans-serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
|
||||
cairo_select_font_face(ctx, status_font, CAIRO_FONT_SLANT_NORMAL,
|
||||
CAIRO_FONT_WEIGHT_NORMAL);
|
||||
cairo_set_font_size(ctx, text_size);
|
||||
switch (auth_state) {
|
||||
case STATE_AUTH_VERIFY:
|
||||
|
|
Loading…
Add table
Reference in a new issue