From 63a55dd06cb98e8b00a232ad8ae7b4ac133c4d6e Mon Sep 17 00:00:00 2001 From: Chad Voegele Date: Tue, 14 Jul 2015 10:47:49 -0700 Subject: [PATCH 1/4] Keep percent signs if not followed by {} block. The before code would skip a percent sign even if it was not followed by a {} block. The after code checks the same condition but only advances p if a {} block is found and otherwise passes it through as text. --- lemonbar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lemonbar.c b/lemonbar.c index 794d815..ec00e6d 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -485,7 +485,8 @@ parse (char *text) if (*p == '\0' || *p == '\n') return; - if (*p == '%' && p++ && *p == '{' && (block_end = strchr(p++, '}'))) { + if (*p == '%' && *(p+1) == '{' && (block_end = strchr(p++, '}'))) { + p++; while (p < block_end) { while (isspace(*p)) p++; From 71ed0d3375a4ed317b427478d0a96db9db71d2a9 Mon Sep 17 00:00:00 2001 From: chad Date: Sun, 27 Sep 2015 15:21:49 -0500 Subject: [PATCH 2/4] Rewrite *p, *(p+1) as p[0], p[1] for readability. --- lemonbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemonbar.c b/lemonbar.c index ec00e6d..065ecd6 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -485,7 +485,7 @@ parse (char *text) if (*p == '\0' || *p == '\n') return; - if (*p == '%' && *(p+1) == '{' && (block_end = strchr(p++, '}'))) { + if (p[0] == '%' && p[1] == '{' && (block_end = strchr(p++, '}'))) { p++; while (p < block_end) { while (isspace(*p)) From 177deb0860c3e6ac443f3560978f31672e31ed05 Mon Sep 17 00:00:00 2001 From: neeasade Date: Sun, 12 Apr 2015 08:07:57 -0500 Subject: [PATCH 3/4] bar -> lemonbar in .gitignore, remove config.h in .gitignore --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 519ae3a..01a163f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -config.h -bar +lemonbar *.o *.swp *~ From 7f8a79131b39ff63d2b91eacc252417dca3211bd Mon Sep 17 00:00:00 2001 From: Nathan Isom Date: Wed, 21 Oct 2015 00:22:52 -0500 Subject: [PATCH 4/4] Account for height of monitors in sorting. --- lemonbar.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lemonbar.c b/lemonbar.c index 065ecd6..39c4975 100644 --- a/lemonbar.c +++ b/lemonbar.c @@ -541,7 +541,7 @@ parse (char *text) break; case 'T': - if (*p == '-') { //Reset to automatic font selection + if (*p == '-') { //Reset to automatic font selection font_index = -1; p++; break; @@ -784,10 +784,15 @@ rect_sort_cb (const void *p1, const void *p2) const xcb_rectangle_t *r1 = (xcb_rectangle_t *)p1; const xcb_rectangle_t *r2 = (xcb_rectangle_t *)p2; - if (r1->x < r2->x || r1->y < r2->y) + if (r1->x < r2->x || r1->y + r1->height <= r2->y) + { return -1; - if (r1->x > r2->x || r1->y > r2->y) - return 1; + } + + if (r1->x > r2->x || r1->y + r1->height > r2->y) + { + return 1; + } return 0; }