Adding underlinetags patch ref. #199

This commit is contained in:
bakkeby 2021-11-23 22:49:27 +01:00
parent 63fed59d19
commit a9078fdb4d
5 changed files with 26 additions and 4 deletions

View File

@ -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~

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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.