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:
|
### Changelog:
|
||||||
|
|
||||||
|
2019-09-13 - Added titlecolor patch
|
||||||
|
|
||||||
2019-09-12 - Added activetagindicatorbar, alwaysfullscreen and autoresize patches
|
2019-09-12 - Added activetagindicatorbar, alwaysfullscreen and autoresize patches
|
||||||
|
|
||||||
2019-09-11 - Added monitor rules, combo and ewmhtags 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)
|
- [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
|
- 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)
|
- [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
|
- allows you to toggle fullscreen on and off using a single shortcut key
|
||||||
|
|
||||||
@ -180,4 +185,4 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
- horizontal grid layout
|
- horizontal grid layout
|
||||||
|
|
||||||
- [nrowgrid](https://dwm.suckless.org/patches/nrowgrid/)
|
- [nrowgrid](https://dwm.suckless.org/patches/nrowgrid/)
|
||||||
- nrowgrid layout, number of rows in grid controlled by nmaster
|
- nrowgrid layout, number of rows in grid controlled by nmaster
|
||||||
|
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 baralpha = 0xd0;
|
||||||
static const unsigned int borderalpha = OPAQUE;
|
static const unsigned int borderalpha = OPAQUE;
|
||||||
static const unsigned int alphas[][3] = {
|
static const unsigned int alphas[][3] = {
|
||||||
/* fg bg border */
|
/* fg bg border */
|
||||||
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
|
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
|
||||||
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
|
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBA R_PATCH
|
||||||
[SchemeHid] = { OPAQUE, baralpha, borderalpha },
|
[SchemeHid] = { OPAQUE, baralpha, borderalpha },
|
||||||
#endif // AWESOMEBAR_PATCH
|
#endif // AWESOMEBAR_PATCH
|
||||||
|
#if TITLECOLOR_PATCH
|
||||||
|
[SchemeTitle] = { OPAQUE, baralpha, borderalpha },
|
||||||
|
#endif // TITLECOLOR_PATCH
|
||||||
};
|
};
|
||||||
#endif // ALPHA_PATCH
|
#endif // ALPHA_PATCH
|
||||||
#if FLOAT_BORDER_COLOR_PATCH
|
#if FLOAT_BORDER_COLOR_PATCH
|
||||||
static const char *colors[][4] = {
|
static const char *colors[][4] = {
|
||||||
/* fg bg border float */
|
/* fg bg border float */
|
||||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2, col_gray2 },
|
[SchemeNorm] = { col_gray3, col_gray1, col_gray2, col_gray2 },
|
||||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan, col_cyan },
|
[SchemeSel] = { col_gray4, col_cyan, col_cyan, col_cyan },
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
[SchemeHid] = { col_cyan, col_gray1, col_cyan, col_cyan },
|
[SchemeHid] = { col_cyan, col_gray1, col_cyan, col_cyan },
|
||||||
#endif // AWESOMEBAR_PATCH
|
#endif // AWESOMEBAR_PATCH
|
||||||
|
#if TITLECOLOR_PATCH
|
||||||
|
[SchemeTitle] = { col_gray4, col_cyan, col_cyan, col_cyan },
|
||||||
|
#endif // TITLECOLOR_PATCH
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
static const char *colors[][3] = {
|
static const char *colors[][3] = {
|
||||||
/* fg bg border */
|
/* fg bg border */
|
||||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||||
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
[SchemeHid] = { col_cyan, col_gray1, col_cyan },
|
[SchemeHid] = { col_cyan, col_gray1, col_cyan },
|
||||||
#endif // AWESOMEBAR_PATCH
|
#endif // AWESOMEBAR_PATCH
|
||||||
|
#if TITLECOLOR_PATCH
|
||||||
|
[SchemeTitle] = { col_gray4, col_cyan, col_cyan },
|
||||||
|
#endif // TITLECOLOR_PATCH
|
||||||
};
|
};
|
||||||
#endif // FLOAT_BORDER_COLOR_PATCH
|
#endif // FLOAT_BORDER_COLOR_PATCH
|
||||||
|
|
||||||
|
30
dwm.c
30
dwm.c
@ -68,11 +68,18 @@
|
|||||||
|
|
||||||
/* enums */
|
/* enums */
|
||||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||||
#if AWESOMEBAR_PATCH
|
|
||||||
enum { SchemeNorm, SchemeSel, SchemeHid }; /* color schemes */
|
enum {
|
||||||
#else
|
SchemeNorm
|
||||||
enum { SchemeNorm, SchemeSel }; /* color schemes */
|
,SchemeSel
|
||||||
#endif // #if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
|
,SchemeHid
|
||||||
|
#endif // AWESOMEBAR_PATCH
|
||||||
|
#if TITLECOLOR_PATCH
|
||||||
|
,SchemeTitle
|
||||||
|
#endif // TITLECOLOR_PATCH
|
||||||
|
}; /* color schemes */
|
||||||
|
|
||||||
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
|
||||||
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
|
||||||
#if SYSTRAY_PATCH
|
#if SYSTRAY_PATCH
|
||||||
@ -1100,11 +1107,16 @@ drawbar(Monitor *m)
|
|||||||
if (!ISVISIBLE(c))
|
if (!ISVISIBLE(c))
|
||||||
continue;
|
continue;
|
||||||
if (m->sel == c)
|
if (m->sel == c)
|
||||||
|
#if TITLECOLOR_PATCH
|
||||||
|
scm = SchemeTitle;
|
||||||
|
#else
|
||||||
scm = SchemeSel;
|
scm = SchemeSel;
|
||||||
|
#endif // TITLECOLOR_PATCH
|
||||||
else if (HIDDEN(c))
|
else if (HIDDEN(c))
|
||||||
scm = SchemeHid;
|
scm = SchemeHid;
|
||||||
else
|
else
|
||||||
scm = SchemeNorm;
|
scm = SchemeNorm;
|
||||||
|
|
||||||
drw_setscheme(drw, scheme[scm]);
|
drw_setscheme(drw, scheme[scm]);
|
||||||
drw_text(drw, x, 0, (1.0 / (double)n) * w, bh, lrpad / 2, c->name, 0);
|
drw_text(drw, x, 0, (1.0 / (double)n) * w, bh, lrpad / 2, c->name, 0);
|
||||||
x += (1.0 / (double)n) * w;
|
x += (1.0 / (double)n) * w;
|
||||||
@ -1136,7 +1148,11 @@ drawbar(Monitor *m)
|
|||||||
continue;
|
continue;
|
||||||
tw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
|
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]);
|
drw_setscheme(drw, scheme[m->sel == c ? SchemeSel : SchemeNorm]);
|
||||||
|
#endif // TITLECOLOR_PATCH
|
||||||
if (tw > 0) /* trap special handling of 0 in drw_text */
|
if (tw > 0) /* trap special handling of 0 in drw_text */
|
||||||
drw_text(drw, x, 0, tw, bh, lrpad / 2, c->name, 0);
|
drw_text(drw, x, 0, tw, bh, lrpad / 2, c->name, 0);
|
||||||
if (c->isfloating)
|
if (c->isfloating)
|
||||||
@ -1149,7 +1165,11 @@ drawbar(Monitor *m)
|
|||||||
drw_rect(drw, x, 0, w, bh, 1, 1);
|
drw_rect(drw, x, 0, w, bh, 1, 1);
|
||||||
#else
|
#else
|
||||||
if (m->sel) {
|
if (m->sel) {
|
||||||
|
#if TITLECOLOR_PATCH
|
||||||
|
drw_setscheme(drw, scheme[m == selmon ? SchemeTitle : SchemeNorm]);
|
||||||
|
#else
|
||||||
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
|
||||||
|
#endif // TITLECOLOR_PATCH
|
||||||
#if CENTEREDWINDOWNAME_PATCH
|
#if CENTEREDWINDOWNAME_PATCH
|
||||||
int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
|
int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
|
||||||
drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
|
drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
|
||||||
|
@ -225,6 +225,11 @@
|
|||||||
*/
|
*/
|
||||||
#define TAGSWAPMON_PATCH 0
|
#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.
|
/* 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
|
* https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-togglefullscreen-6.2.diff
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user