dwm

[fork] dynamic window manager
Log | Files | Refs | README | LICENSE

commit f8056b9384bb73442d52a492fa0335d625413205
parent ca451922f6669f6fb403460a31b77f9831792047
Author: hhvn <dev@hhvn.uk>
Date:   Mon,  7 Feb 2022 17:53:58 +0000

config.h dwm.c: simplify schemes

Diffstat:
Mconfig.h | 11+++++------
Mdwm.c | 24++++++++----------------
2 files changed, 13 insertions(+), 22 deletions(-)

diff --git a/config.h b/config.h @@ -17,12 +17,11 @@ static const char *const azure = "#aaaaff"; static const char *const green = "#0a2126"; static const char *colors[][3] = { /* fg bg border */ - [SchemeNorm] = { bright, dark, dark }, - [SchemeSel] = { bright, blue, blue }, - [SchemeStat] = { azure, green, dark }, - [SchemeBarInact] = { grey, dark, dark }, - [SchemeNormFloat] = { bright, dark, dark }, - [SchemeUrgent] = { red, dark, dark }, + [SchemeNorm] = { bright, dark, dark }, + [SchemeSel] = { bright, blue, blue }, + [SchemeStat] = { azure, green, dark }, + [SchemeInact] = { grey, dark, dark }, + [SchemeUrgent] = { red, dark, dark }, }; /* tagging */ diff --git a/dwm.c b/dwm.c @@ -68,7 +68,7 @@ /* enums */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ -enum { SchemeNorm, SchemeSel, SchemeStat, SchemeBarInact, SchemeUrgent, SchemeNormFloat}; /* color schemes */ +enum { SchemeNorm, SchemeSel, SchemeStat, SchemeInact, SchemeUrgent}; /* color schemes */ enum { NetSupported, NetWMName, NetWMState, NetWMCheck, NetWMFullscreen, NetActiveWindow, NetWMWindowType, NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ @@ -862,7 +862,7 @@ drawbar(Monitor *m) if (m->sel == c && m == selmon) scm = SchemeSel; else - scm = SchemeBarInact; + scm = SchemeInact; drw_setscheme(drw, scheme[scm]); if (remainder >= 0) { @@ -882,13 +882,11 @@ drawbar(Monitor *m) x += tabw; } } else { - if (m == selmon) { + if (m == selmon) drw_setscheme(drw, scheme[SchemeSel]); - drw_rect(drw, x, 0, w - borderpx, bh, 1, 1); - } else { - drw_setscheme(drw, scheme[SchemeNorm]); - drw_rect(drw, x, 0, w, bh, 1, 1); - } + else + drw_setscheme(drw, scheme[SchemeInact]); + drw_rect(drw, x, 0, w, bh, 1, 1); } } @@ -1184,10 +1182,7 @@ manage(Window w, XWindowAttributes *wa) wc.border_width = c->bw; XConfigureWindow(dpy, w, CWBorderWidth, &wc); - if (c->isfloating) - XSetWindowBorder(dpy, w, scheme[SchemeNormFloat][ColBorder].pixel); - else - XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); + XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColBorder].pixel); configure(c); /* propagates border_width, if size doesn't change */ updatewindowtype(c); updatesizehints(c); @@ -1803,10 +1798,7 @@ unfocus(Client *c, int setfocus) { if (!c) return; - if (c->isfloating) - XSetWindowBorder(dpy, c->win, scheme[SchemeNormFloat][ColBorder].pixel); - else - XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); + XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel); if (setfocus) { XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); XDeleteProperty(dpy, root, netatom[NetActiveWindow]);