- else if (!strncmp(var, "bar_border",
- strlen("bar_border")))
- for (i = 0; i < ScreenCount(display); i++)
- screens[i].bar_border = name_to_color(val);
- else if (!strncmp(var, "bar_color",
- strlen("bar_color")))
- for (i = 0; i < ScreenCount(display); i++)
- screens[i].bar_color = name_to_color(val);
- else if (!strncmp(var, "bar_font_color",
- strlen("bar_font_color")))
- for (i = 0; i < ScreenCount(display); i++)
- screens[i].bar_font_color = name_to_color(val);
+ else if (!varmatch(var, "bar_border", &i))
+ if (i > 0 && i <= sc)
+ screens[i - 1].bar_border =
+ name_to_color(val);
+ else if (i == -1)
+ for (i = 0; i < sc; i++)
+ screens[i].bar_border =
+ name_to_color(val);
+ else
+ goto badidx;
+ else if (!varmatch(var, "bar_color", &i))
+ if (i > 0 && i <= sc)
+ screens[i - 1].bar_color =
+ name_to_color(val);
+ else if (i == -1)
+ for (i = 0; i < sc; i++)
+ screens[i].bar_color =
+ name_to_color(val);
+ else
+ goto badidx;
+ else if (!varmatch(var, "bar_font_color", &i))
+ if (i > 0 && i <= sc)
+ screens[i - 1].bar_font_color =
+ name_to_color(val);
+ else if (i == -1)
+ for (i = 0; i < sc; i++)
+ screens[i].bar_font_color =
+ name_to_color(val);
+ else
+ goto badidx;
+