diff options
| author | kolunmi <113054217+kolunmi@users.noreply.github.com> | 2023-11-28 19:40:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-28 19:40:55 -0700 |
| commit | d2150540f5860d41d7fce97769f94a557986051a (patch) | |
| tree | 5a8c70ff275f6f603012a25f91d100fcdca07028 | |
| parent | f5739f35d417cfb63fe8eece38c3b5ceb02f9117 (diff) | |
| parent | bbbba9f720102c61bda518941cdfdd0820912e67 (diff) | |
| download | dwlb-d2150540f5860d41d7fce97769f94a557986051a.tar.gz | |
Merge pull request #33 from Hiqqup/middle_color_arg
Implement color options for middle part of bar
| -rw-r--r-- | config.def.h | 2 | ||||
| -rw-r--r-- | dwlb.c | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h index 920717e..017258e 100644 --- a/config.def.h +++ b/config.def.h @@ -32,3 +32,5 @@ static pixman_color_t inactive_fg_color = { .red = 0xbbbb, .green = 0xbbbb, .blu static pixman_color_t inactive_bg_color = { .red = 0x2222, .green = 0x2222, .blue = 0x2222, .alpha = 0xffff, }; static pixman_color_t urgent_fg_color = { .red = 0x2222, .green = 0x2222, .blue = 0x2222, .alpha = 0xffff, }; static pixman_color_t urgent_bg_color = { .red = 0xeeee, .green = 0xeeee, .blue = 0xeeee, .alpha = 0xffff, }; +static pixman_color_t middle_bg_color = { .red = 0x2222, .green = 0x2222, .blue = 0x2222, .alpha = 0xffff, }; +static pixman_color_t middle_bg_color_selected = { .red = 0x0000, .green = 0x5555, .blue = 0x7777, .alpha = 0xffff, }; @@ -95,6 +95,8 @@ " -inactive-bg-color [COLOR] specify background color of inactive tags or monitors\n" \ " -urgent-fg-color [COLOR] specify text color of urgent tags\n" \ " -urgent-bg-color [COLOR] specify background color of urgent tags\n" \ + " -middle-bg-color [COLOR] specify background color of the color in the middle of the bar\n" \ + " -middle-bg-color-selected [COLOR] specify background color of the color in the middle of the bar, when selected\n" \ " -scale [BUFFER_SCALE] specify buffer scale value for integer scaling\n" \ "Commands\n" \ " -target-socket [SOCKET-NAME] set the socket to send command to. Sockets can be found in `$XDG_RUNTIME_DIR/dwlb/`\n"\ @@ -441,7 +443,7 @@ draw_frame(Bar *bar) nx = MIN(x + bar->textpadding, bar->width - status_width); } pixman_image_fill_boxes(PIXMAN_OP_SRC, background, - bar->sel ? &active_bg_color : &inactive_bg_color, 1, + bar->sel ? &middle_bg_color_selected : &middle_bg_color, 1, &(pixman_box32_t){ .x1 = x, .x2 = nx, .y1 = 0, .y2 = bar->height @@ -457,7 +459,7 @@ draw_frame(Bar *bar) custom_title ? bar->title.colors_l : 0); pixman_image_fill_boxes(PIXMAN_OP_SRC, background, - bar->sel ? &active_bg_color : &inactive_bg_color, 1, + bar->sel ? &middle_bg_color_selected : &middle_bg_color, 1, &(pixman_box32_t){ .x1 = x, .x2 = bar->width - status_width, .y1 = 0, .y2 = bar->height @@ -1765,6 +1767,16 @@ main(int argc, char **argv) DIE("Option -urgent-bg-color requires an argument"); if (parse_color(argv[i], &urgent_bg_color) == -1) DIE("malformed color string"); + } else if (!strcmp(argv[i], "-middle-bg-color-selected")) { + if (++i >= argc) + DIE("Option -middle-bg-color-selected requires an argument"); + if (parse_color(argv[i], &middle_bg_color_selected) == -1) + DIE("malformed color string"); + } else if (!strcmp(argv[i], "-middle-bg-color")) { + if (++i >= argc) + DIE("Option -middle-bg-color requires an argument"); + if (parse_color(argv[i], &middle_bg_color) == -1) + DIE("malformed color string"); } else if (!strcmp(argv[i], "-tags")) { if (++i >= argc) DIE("Option -tags requires at least one argument"); |