Merge branch 'master' into refactor-background-drawing
This commit is contained in:
commit
ad7b33bd2c
30
i3lock.c
30
i3lock.c
|
@ -279,8 +279,7 @@ double bar_step = 15;
|
||||||
double bar_base_height = 25;
|
double bar_base_height = 25;
|
||||||
double bar_periodic_step = 15;
|
double bar_periodic_step = 15;
|
||||||
double max_bar_height = 25;
|
double max_bar_height = 25;
|
||||||
int bar_count = 0;
|
int bar_count = 10;
|
||||||
int bar_width = 0;
|
|
||||||
int bar_orientation = BAR_FLAT;
|
int bar_orientation = BAR_FLAT;
|
||||||
|
|
||||||
char bar_base_color[9] = "000000ff";
|
char bar_base_color[9] = "000000ff";
|
||||||
|
@ -1548,7 +1547,6 @@ int main(int argc, char *argv[]) {
|
||||||
// bar indicator stuff
|
// bar indicator stuff
|
||||||
{"bar-indicator", no_argument, NULL, 700},
|
{"bar-indicator", no_argument, NULL, 700},
|
||||||
{"bar-direction", required_argument, NULL, 701},
|
{"bar-direction", required_argument, NULL, 701},
|
||||||
{"bar-width", required_argument, NULL, 702},
|
|
||||||
{"bar-orientation", required_argument, NULL, 703},
|
{"bar-orientation", required_argument, NULL, 703},
|
||||||
{"bar-step", required_argument, NULL, 704},
|
{"bar-step", required_argument, NULL, 704},
|
||||||
{"bar-max-height", required_argument, NULL, 705},
|
{"bar-max-height", required_argument, NULL, 705},
|
||||||
|
@ -2125,10 +2123,6 @@ int main(int argc, char *argv[]) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 702:
|
|
||||||
bar_width = atoi(optarg);
|
|
||||||
if (bar_width < 1) bar_width = 150;
|
|
||||||
break;
|
|
||||||
case 703:
|
case 703:
|
||||||
arg = optarg;
|
arg = optarg;
|
||||||
if (strcmp(arg, "vertical") == 0)
|
if (strcmp(arg, "vertical") == 0)
|
||||||
|
@ -2323,27 +2317,7 @@ int main(int argc, char *argv[]) {
|
||||||
last_resolution[1] = screen->height_in_pixels;
|
last_resolution[1] = screen->height_in_pixels;
|
||||||
|
|
||||||
if (bar_enabled) {
|
if (bar_enabled) {
|
||||||
if (bar_count == 0) {
|
bar_heights = (double*) calloc(bar_count, sizeof(double));
|
||||||
if (bar_width != 0) {
|
|
||||||
fprintf(stderr, "Warning: bar-width is deprecated, use bar-count instead\n");
|
|
||||||
int tmp = screen->width_in_pixels;
|
|
||||||
if (bar_orientation == BAR_VERT) tmp = screen->height_in_pixels;
|
|
||||||
bar_count = tmp / bar_width;
|
|
||||||
if (tmp % bar_width != 0) {
|
|
||||||
++bar_count;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
bar_count = 10;
|
|
||||||
}
|
|
||||||
} else if (bar_width != 0) {
|
|
||||||
errx(EXIT_FAILURE, "bar-width and bar-count cannot be used at the same time");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bar_count >= MIN_BAR_COUNT && bar_count <= MAX_BAR_COUNT) {
|
|
||||||
bar_heights = (double*) calloc(bar_count, sizeof(double));
|
|
||||||
} else {
|
|
||||||
bar_enabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xcb_change_window_attributes(conn, screen->root, XCB_CW_EVENT_MASK,
|
xcb_change_window_attributes(conn, screen->root, XCB_CW_EVENT_MASK,
|
||||||
|
|
Loading…
Reference in New Issue