mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding titlecolor patch
This commit is contained in:
parent
9d82e39580
commit
c5b830e6ab
@ -13,6 +13,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
||||
|
||||
### Changelog:
|
||||
|
||||
2019-09-13 - Added titlecolor patch
|
||||
|
||||
2019-09-12 - Added activetagindicatorbar, alwaysfullscreen and autoresize patches
|
||||
|
||||
2019-09-11 - Added monitor rules, combo and ewmhtags patches
|
||||
@ -130,6 +132,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
||||
- [tagswapmon](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-tagswapmon-6.2.diff)
|
||||
- swap all visible windows on one monitor with those of an adjacent monitor
|
||||
|
||||
- [titlecolor](https://dwm.suckless.org/patches/titlecolor/)
|
||||
- adds a new color scheme used by the (selected) window title in the bar
|
||||
|
||||
- [togglefullscreen](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff)
|
||||
- allows you to toggle fullscreen on and off using a single shortcut key
|
||||
|
||||
|
35
config.def.h
35
config.def.h
@ -33,31 +33,40 @@ static const char col_cyan[] = "#005577";
|
||||
static const unsigned int baralpha = 0xd0;
|
||||
static const unsigned int borderalpha = OPAQUE;
|
||||
static const unsigned int alphas[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
|
||||
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
|
||||
#if AWESOMEBAR_PATCH
|
||||
[SchemeHid] = { OPAQUE, baralpha, borderalpha },
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
|
||||
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
|
||||
#if AWESOMEBA R_PATCH
|
||||
[SchemeHid] = { OPAQUE, baralpha, borderalpha },
|
||||
#endif // AWESOMEBAR_PATCH
|
||||
#if TITLECOLOR_PATCH
|
||||
[SchemeTitle] = { OPAQUE, baralpha, borderalpha },
|
||||
#endif // TITLECOLOR_PATCH
|
||||
};
|
||||
#endif // ALPHA_PATCH
|
||||
#if FLOAT_BORDER_COLOR_PATCH
|
||||
static const char *colors[][4] = {
|
||||
/* fg bg border float */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan, col_cyan },
|
||||
/* fg bg border float */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan, col_cyan },
|
||||
#if AWESOMEBAR_PATCH
|
||||
[SchemeHid] = { col_cyan, col_gray1, col_cyan, col_cyan },
|
||||
[SchemeHid] = { col_cyan, col_gray1, col_cyan, col_cyan },
|
||||
#endif // AWESOMEBAR_PATCH
|
||||
#if TITLECOLOR_PATCH
|
||||
[SchemeTitle] = { col_gray4, col_cyan, col_cyan, col_cyan },
|
||||
#endif // TITLECOLOR_PATCH
|
||||
};
|
||||
#else
|
||||
static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||
#if AWESOMEBAR_PATCH
|
||||
[SchemeHid] = { col_cyan, col_gray1, col_cyan },
|
||||
[SchemeHid] = { col_cyan, col_gray1, col_cyan },
|
||||
#endif // AWESOMEBAR_PATCH
|
||||
#if TITLECOLOR_PATCH
|
||||
[SchemeTitle] = { col_gray4, col_cyan, col_cyan },
|
||||
#endif // TITLECOLOR_PATCH
|
||||
};
|
||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||
|
||||
|
30
dwm.c
30
dwm.c
@ -68,11 +68,18 @@
|
||||
|
||||
/* enums */
|
||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||
#if AWESOMEBAR_PATCH
|
||||
enum { SchemeNorm, SchemeSel, SchemeHid }; /* color schemes */
|
||||
#else
|
||||
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
||||
#endif // #if AWESOMEBAR_PATCH
|
||||
|
||||
enum {
|
||||
SchemeNorm
|
||||
,SchemeSel
|
||||
#if AWESOMEBAR_PATCH
|
||||
,SchemeHid
|
||||
#endif // AWESOMEBAR_PATCH
|
||||
#if TITLECOLOR_PATCH
|
||||
,SchemeTitle
|
||||
#endif // TITLECOLOR_PATCH
|
||||
}; /* color schemes */
|
||||
|
||||
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
||||
#if SYSTRAY_PATCH
|
||||
@ -1100,11 +1107,16 @@ drawbar(Monitor *m)
|
||||
if (!ISVISIBLE(c))
|
||||
continue;
|
||||
if (m->sel == c)
|
||||
#if TITLECOLOR_PATCH
|
||||
scm = SchemeTitle;
|
||||
#else
|
||||
scm = SchemeSel;
|
||||
#endif // TITLECOLOR_PATCH
|
||||
else if (HIDDEN(c))
|
||||
scm = SchemeHid;
|
||||
else
|
||||
scm = SchemeNorm;
|
||||
|
||||
drw_setscheme(drw, scheme[scm]);
|
||||
drw_text(drw, x, 0, (1.0 / (double)n) * w, bh, lrpad / 2, c->name, 0);
|
||||
x += (1.0 / (double)n) * w;
|
||||
@ -1136,7 +1148,11 @@ drawbar(Monitor *m)
|
||||
continue;
|
||||
tw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
|
||||
|
||||
#if TITLECOLOR_PATCH
|
||||
drw_setscheme(drw, scheme[m->sel == c ? SchemeTitle : SchemeNorm]);
|
||||
#else
|
||||
drw_setscheme(drw, scheme[m->sel == c ? SchemeSel : SchemeNorm]);
|
||||
#endif // TITLECOLOR_PATCH
|
||||
if (tw > 0) /* trap special handling of 0 in drw_text */
|
||||
drw_text(drw, x, 0, tw, bh, lrpad / 2, c->name, 0);
|
||||
if (c->isfloating)
|
||||
@ -1149,7 +1165,11 @@ drawbar(Monitor *m)
|
||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||
#else
|
||||
if (m->sel) {
|
||||
#if TITLECOLOR_PATCH
|
||||
drw_setscheme(drw, scheme[m == selmon ? SchemeTitle : SchemeNorm]);
|
||||
#else
|
||||
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
||||
#endif // TITLECOLOR_PATCH
|
||||
#if CENTEREDWINDOWNAME_PATCH
|
||||
int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
|
||||
drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
|
||||
|
@ -225,6 +225,11 @@
|
||||
*/
|
||||
#define TAGSWAPMON_PATCH 0
|
||||
|
||||
/* Adds a new color scheme used by the (selected) window title in the bar.
|
||||
* https://dwm.suckless.org/patches/titlecolor/
|
||||
*/
|
||||
#define TITLECOLOR_PATCH 0
|
||||
|
||||
/* This patch allows you to toggle fullscreen on and off using a single shortcut key.
|
||||
* https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user