diff options
| author | anabasis <anabasis@noreply.codeberg.org> | 2024-05-11 23:30:37 -0400 |
|---|---|---|
| committer | anabasis <anabasis@noreply.codeberg.org> | 2024-05-11 23:30:37 -0400 |
| commit | 2c29867bedcb28ae276b89eee834557bb2d13e8c (patch) | |
| tree | 249eda6df27f157113ef4495e74a5e4120ccd371 | |
| parent | f0baa70529ecee8761dc7efed572fdcbedc6c57d (diff) | |
| download | dwlb-2c29867bedcb28ae276b89eee834557bb2d13e8c.tar.gz | |
add active_color_title option to set title color
| -rw-r--r-- | config.def.h | 2 | ||||
| -rw-r--r-- | dwlb.c | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/config.def.h b/config.def.h index 7eee538..131a857 100644 --- a/config.def.h +++ b/config.def.h @@ -20,6 +20,8 @@ static bool status_commands = true; static bool center_title = false; // use title space as status text element static bool custom_title = false; +// title color use active colors +static bool active_color_title = true; // scale static uint32_t buffer_scale = 1; // font @@ -84,6 +84,8 @@ " -no-center-title do not center title text on bar\n" \ " -custom-title do not display window title and treat the area as another status text element; see -title command\n" \ " -no-custom-title display current window title as normal\n" \ + " -active-color-title title colors will use active colors\n" \ + " -no-active-color-title title colors will use inactive colors\n" \ " -font [FONT] specify a font\n" \ " -tags [NUMBER] [FIRST]...[LAST] if ipc is disabled, specify custom tag names. If NUMBER is 0, then no tag names should be given \n" \ " -vertical-padding [PIXELS] specify vertical pixel padding above and below text\n" \ @@ -454,8 +456,8 @@ draw_frame(Bar *bar) x = draw_text(custom_title ? bar->title.text : bar->window_title, x, y, foreground, background, - bar->sel ? &active_fg_color : &inactive_fg_color, - bar->sel ? &active_bg_color : &inactive_bg_color, + (bar->sel && active_color_title) ? &active_fg_color : &inactive_fg_color, + (bar->sel && active_color_title) ? &active_bg_color : &inactive_bg_color, bar->width - status_width, bar->height, 0, custom_title ? bar->title.colors : NULL, custom_title ? bar->title.colors_l : 0); @@ -1767,6 +1769,10 @@ main(int argc, char **argv) custom_title = true; } else if (!strcmp(argv[i], "-no-custom-title")) { custom_title = false; + } else if (!strcmp(argv[i], "-active-color-title")) { + active_color_title = true; + } else if (!strcmp(argv[i], "-no-active-color-title")) { + active_color_title = false; } else if (!strcmp(argv[i], "-font")) { if (++i >= argc) DIE("Option -font requires an argument"); |