i3lock-color

The world's most popular non-default computer lockscreen.
Index Commits Files Refs README LICENSE
commit 45b8c7ee3131086054b778adac2141b1bf49cc1a
parent c73a65fd9d35c2672832116018e021c6f2b5ace6
Author: Raymond Li <hi@raymond.li>
Date:   Mon, 25 Jan 2021 23:17:14 -0500

Use a BAR_MIN_COUNT and set it to 2
Diffstat:
Mi3lock.c | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/i3lock.c b/i3lock.c
@@ -269,6 +269,7 @@ bool redraw_thread = false;
 #define BAR_REVERSED 1
 #define BAR_BIDIRECTIONAL 2
 #define BAR_MAX_COUNT 65535
+#define BAR_MIN_COUNT 2
 
 bool bar_enabled = false;
 double *bar_heights = NULL;
@@ -276,7 +277,7 @@ double bar_step = 15;
 double bar_base_height = 25;
 double bar_periodic_step = 15;
 double max_bar_height = 25;
-int bar_count = 10;
+int bar_count = BAR_MIN_COUNT;
 int bar_width = 0;
 int bar_orientation = BAR_FLAT;
 
@@ -2136,8 +2137,12 @@ int main(int argc, char *argv[]) {
                 break;
             case 710:
                 bar_count = atoi(optarg);
-                if (bar_count > BAR_MAX_COUNT) bar_count = BAR_MAX_COUNT;
-                if (bar_count < 1) bar_count = 10;
+                if (bar_count > BAR_MAX_COUNT) {
+                    bar_count = BAR_MAX_COUNT;
+                }
+                if (bar_count < BAR_MIN_COUNT) {
+                    bar_count = BAR_MIN_COUNT;
+                }
                 break;
 
             // Misc