This commit is contained in:
DarthMooMancer
2025-08-04 12:43:36 -04:00
parent 51c90a88f8
commit 9b04646c65
20 changed files with 100 additions and 423 deletions
-2
View File
@@ -3,7 +3,6 @@ static const unsigned int gappx = 10;
static const unsigned int snap = 32;
static const int showbar = 1;
static const int topbar = 1;
static const char *barlayout = "t|s";
static const char *fonts[] = { "CaskaydiaCove NFM style:SemiBold:size=11" };
static const char *colors[][3] = {
@@ -26,7 +25,6 @@ static const int lockfullscreen = 1;
static const Layout layouts[] = {
{ "[]=", tile },
{ "><>", NULL }, /* no layout function means floating behavior */
};
#define MODKEY Mod1Mask
+1 -10
View File
@@ -1,24 +1,15 @@
VERSION = 6.5
PREFIX = /usr/local
X11INC = /usr/X11R6/include
X11LIB = /usr/X11R6/lib
# Xinerama, comment if you don't want it
# XINERAMALIBS = -lXinerama
# XINERAMAFLAGS = -DXINERAMA
# freetype
FREETYPELIBS = -lfontconfig -lXft
FREETYPEINC = /usr/include/freetype2
# includes and libs
INCS = -I${X11INC} -I${FREETYPEINC}
LIBS = -L${X11LIB} -lX11 ${FREETYPELIBS}
# flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\"
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L
#CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS}
CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS}
LDFLAGS = ${LIBS}
+36 -80
View File
@@ -658,97 +658,53 @@ dirtomon(int dir)
void
drawbar(Monitor *m)
{
int x = 0, w, tw = 0, moveright = 0;
int x, w, tw = 0;
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, j, occ = 0, urg = 0;
unsigned int i, occ = 0, urg = 0;
Client *c;
if (!m->showbar)
return;
if (barlayout[0] == '\0')
barlayout = "tln|s";
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
}
for (c = m->clients; c; c = c->next) {
occ |= c->tags;
if (c->isurgent)
urg |= c->tags;
}
x = 0;
for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
if (occ & 1 << i)
drw_rect(drw, x + boxs, boxs, boxw, boxw,
m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
urg & 1 << i);
x += w;
}
w = TEXTW(m->ltsymbol);
drw_setscheme(drw, scheme[SchemeNorm]);
drw_text(drw, 0, 0, m->ww, bh, 0, "", 0); /* draw background */
for (i = 0; i < strlen(barlayout); i++) {
switch (barlayout[i]) {
case 'l':
w = TEXTW(m->ltsymbol);
drw_setscheme(drw, scheme[SchemeNorm]);
if (moveright) {
x -= w;
drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
} else
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
break;
case 'n':
tw = TEXTW(m->sel->name);
if (moveright)
x -= tw;
if (m->sel) {
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, moveright ? tw : m->ww, bh, lrpad / 2, m->sel->name, 0);
if (m->sel->isfloating)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
} else {
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x, 0, tw, bh, 1, 1);
}
if (!moveright)
x += tw;
break;
case 's':
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
if (moveright) {
x -= tw;
drw_text(drw, x, 0, tw, bh, 0, stext, 0);
} else
x = drw_text(drw, x, 0, tw, bh, 0, stext, 0);
}
break;
case 't':
for (c = m->clients; c; c = c->next) {
occ |= c->tags;
if (c->isurgent)
urg |= c->tags;
}
/* tags */
if (moveright) {
tw = 0;
for (j = 0; j < LENGTH(tags); j++) {
tw += TEXTW(tags[j]);
}
x -= tw;
}
for (j = 0; j < LENGTH(tags); j++) {
w = TEXTW(tags[j]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << j ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[j], urg & 1 << j);
if (occ & 1 << j)
drw_rect(drw, x + boxs, boxs, boxw, boxw,
m == selmon && selmon->sel && selmon->sel->tags & 1 << j,
urg & 1 << i);
x += w;
}
if (moveright)
x -= tw;
break;
case '|':
moveright = 1;
x = m->ww;
break;
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
if ((w = m->ww - tw - x) > bh) {
if (m->sel) {
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
if (m->sel->isfloating)
drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
} else {
drw_setscheme(drw, scheme[SchemeNorm]);
drw_rect(drw, x, 0, w, bh, 1, 1);
}
}
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
@@ -1908,7 +1864,7 @@ void
updatestatus(void)
{
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
strcpy(stext, "dwm-"VERSION);
strcpy(stext, " dwm ");
drawbar(selmon);
}