diff --git a/README.md b/README.md index d165871..dcc4f9c 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are experiencing issues then you may want to check out the [Known Issues] ### Changelog: -2021-11-23 - Added the taglabels patch +2021-11-23 - Added the taglabels and underlinetags patches 2021-09-08 - Added the alwayscenter patch @@ -469,6 +469,9 @@ If you are experiencing issues then you may want to check out the [Known Issues] - this patch adds key modes (like in vim or emacs) where chains of keyboard shortcuts can be performed + - [killunsel](https://dwm.suckless.org/patches/killunsel/) + - kills all visible clients that are not selected (only the selected client will remain) + - [~leftlayout~](http://dwm.suckless.org/patches/leftlayout/) - ~moves the layout symbol in the status bar to the left hand side~ @@ -746,13 +749,13 @@ If you are experiencing issues then you may want to check out the [Known Issues] - lets you transfer all clients between the master and stack area while increasing or decreasing the master area (nmaster) accordingly + - [underlinetags](https://dwm.suckless.org/patches/underlinetags/) + - underlines the selected tag, or optionally all tags + - [unfloatvisible](https://dwm.suckless.org/patches/unfloatvisible/) - resets isfloating on any visible windows that have it set and optionally also applies a layout - - [killunsel](https://dwm.suckless.org/patches/killunsel/) - - kills all visible clients that are not selected (only the selected client will remain) - - [~urgentborder~](https://dwm.suckless.org/patches/urgentborder/) - ~this patch makes "urgent" windows have different colors~ diff --git a/config.def.h b/config.def.h index 2ed1a25..61dd14a 100644 --- a/config.def.h +++ b/config.def.h @@ -96,6 +96,12 @@ static const char ptagf[] = "[%s %s]"; /* format of a tag label */ static const char etagf[] = "[%s]"; /* format of an empty tag */ static const int lcaselbl = 0; /* 1 means make tag label lowercase */ #endif // BAR_TAGLABELS_PATCH +#if BAR_UNDERLINETAGS_PATCH +static const unsigned int ulinepad = 5; /* horizontal padding between the underline and tag */ +static const unsigned int ulinestroke = 2; /* thickness / height of the underline */ +static const unsigned int ulinevoffset = 0; /* how far above the bottom of the bar the line should appear */ +static const int ulineall = 0; /* 1 to show underline on all tags, 0 for just the active ones */ +#endif // BAR_UNDERLINETAGS_PATCH /* Indicators: see patch/bar_indicators.h for options */ static int tagindicatortype = INDICATOR_TOP_LEFT_SQUARE; diff --git a/patch/bar_taglabels.c b/patch/bar_taglabels.c index f9c3cf8..9e6d441 100644 --- a/patch/bar_taglabels.c +++ b/patch/bar_taglabels.c @@ -63,6 +63,10 @@ draw_taglabels(Bar *bar, BarArg *a) w = TEXTW(m->taglabel[i]); drw_text(drw, x, a->y, w, a->h, lrpad / 2, m->taglabel[i], invert, False); drawindicator(m, NULL, occ, x, a->y, w, a->h, i, -1, invert, tagindicatortype); + #if BAR_UNDERLINETAGS_PATCH + if (ulineall || m->tagset[m->seltags] & 1 << i) + drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0); + #endif // BAR_UNDERLINETAGS_PATCH x += w; } diff --git a/patch/bar_tags.c b/patch/bar_tags.c index c00818d..c618ff5 100644 --- a/patch/bar_tags.c +++ b/patch/bar_tags.c @@ -57,6 +57,10 @@ draw_tags(Bar *bar, BarArg *a) ]); drw_text(drw, x, a->y, w, a->h, lrpad / 2, icon, invert, False); drawindicator(m, NULL, occ, x, a->y, w, a->h, i, -1, invert, tagindicatortype); + #if BAR_UNDERLINETAGS_PATCH + if (ulineall || m->tagset[m->seltags] & 1 << i) + drw_rect(drw, x + ulinepad, bh - ulinestroke - ulinevoffset, w - (ulinepad * 2), ulinestroke, 1, 0); + #endif // BAR_UNDERLINETAGS_PATCH x += w; } diff --git a/patches.def.h b/patches.def.h index 7451dc4..022a4a6 100644 --- a/patches.def.h +++ b/patches.def.h @@ -160,6 +160,11 @@ */ #define BAR_TAGLABELS_PATCH 0 +/* This patch underlines the selected tag, or optionally all tags. + * https://dwm.suckless.org/patches/underlinetags/ + */ +#define BAR_UNDERLINETAGS_PATCH 0 + /* This patch adds the window icon next to the window title in the bar. * * The patch depends on Imlib2 for icon scaling.