update
This commit is contained in:
parent
e7781b8e0d
commit
57da94236a
2
config.def.h
Normal file → Executable file
2
config.def.h
Normal file → Executable file
@ -7,6 +7,8 @@ static const unsigned int snap = 32; /* snap pixel */
|
||||
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const int extrabarright = 0; /* 1 means extra bar text on right */
|
||||
static const char statussep = ';'; /* separator between status bars */
|
||||
static const char *fonts[] = { "monospace:size=8" };
|
||||
static const char dmenufont[] = "monospace:size=8";
|
||||
static const char col_gray1[] = "#222222";
|
||||
|
134
config.def.h.orig
Executable file
134
config.def.h.orig
Executable file
@ -0,0 +1,134 @@
|
||||
/* See LICENSE file for copyright and license details. */
|
||||
|
||||
/* appearance */
|
||||
static const unsigned int borderpx = 2; /* border pixel of windows */
|
||||
static const unsigned int gappx = 5; /* gaps between windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "monospace:size=8" };
|
||||
static const char dmenufont[] = "monospace:size=8";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#bbbbbb";
|
||||
static const char col_gray4[] = "#eeeeee";
|
||||
static const char col_cyan[] = "#005577";
|
||||
//static const char col_orange[] = "#FF7216"; //bright orange
|
||||
//static const char col_orange[] = "#538192"; //rem blue
|
||||
static const char col_orange[] = "#458588";
|
||||
static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_orange, col_orange },
|
||||
[SchemeStatus] = {col_gray3, col_gray1, "#000000"}, //Statusbar right {text, background, not used but must not be empty}
|
||||
[SchemeTagsSel] = {col_gray4,col_cyan, "#000000"},
|
||||
[SchemeTagsNorm] = {col_gray3, col_gray1, "#000000"},
|
||||
[SchemeInfoSel] = {col_gray4, col_cyan, "#000000"},
|
||||
[SchemeInfoNorm] = {col_gray3, col_gray1, "#000000"},
|
||||
};
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* xprop(1):
|
||||
* WM_CLASS(STRING) = instance, class
|
||||
* WM_NAME(STRING) = title
|
||||
*/
|
||||
/* class instance title tags mask isfloating isterminal noswallow monitor */
|
||||
{ "Gimp", NULL, NULL, 0, 0, 0, 0, -1 },
|
||||
{ "Firefox", NULL, NULL, 0, 0, 0, -1, -1 },
|
||||
{ "St", NULL, NULL, 0, 0, 1, 0, -1 },
|
||||
{ NULL, NULL, "Event Tester",0, 0, 0, 1, -1 }, //xev
|
||||
};
|
||||
|
||||
/* layout(s) */
|
||||
static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
|
||||
static const int nmaster = 1; /* number of clients in master area */
|
||||
static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
|
||||
|
||||
static const Layout layouts[] = {
|
||||
/* symbol arrange function */
|
||||
{ "[]=", tile }, /* first entry is default */
|
||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||
{ "[M]", monocle },
|
||||
};
|
||||
|
||||
/* key definitions */
|
||||
#define MODKEY Mod4Mask
|
||||
#define TAGKEYS(KEY,TAG) \
|
||||
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||
|
||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||
|
||||
/* commands */
|
||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_orange, "-sf", col_gray4, NULL };
|
||||
static const char *termcmd[] = { "st", NULL };
|
||||
|
||||
//patch includes
|
||||
#include "shiftview.c"
|
||||
static Key keys[] = {
|
||||
/* modifier key function argument */
|
||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||
//{ MODKEY, XK_b, togglebar, {0} },
|
||||
{ MODKEY, XK_j, focusstack, {.i = +1 } },
|
||||
{ MODKEY, XK_k, focusstack, {.i = -1 } },
|
||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||
{ MODKEY, XK_Return, zoom, {0} },
|
||||
{ MODKEY, XK_Tab, view, {0} },
|
||||
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
|
||||
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
|
||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||
{ MODKEY, XK_space, setlayout, {0} },
|
||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||
{ MODKEY|ShiftMask, XK_l, focusmon, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_h, focusmon, {.i = +1 } },
|
||||
{ MODKEY, XK_minus, setgaps, {.i = -1 } },
|
||||
{ MODKEY, XK_equal, setgaps, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } },
|
||||
{ MODKEY|ShiftMask, XK_i, tagmon, {.i = -1 } },
|
||||
{ MODKEY|ShiftMask, XK_u, tagmon, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_k, shiftview, {.i = +1 } },
|
||||
{ MODKEY|ShiftMask, XK_j, shiftview, {.i = -1 } },
|
||||
TAGKEYS( XK_1, 0)
|
||||
TAGKEYS( XK_2, 1)
|
||||
TAGKEYS( XK_3, 2)
|
||||
TAGKEYS( XK_4, 3)
|
||||
TAGKEYS( XK_5, 4)
|
||||
TAGKEYS( XK_6, 5)
|
||||
TAGKEYS( XK_7, 6)
|
||||
TAGKEYS( XK_8, 7)
|
||||
TAGKEYS( XK_9, 8)
|
||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||
};
|
||||
|
||||
/* button definitions */
|
||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||
static Button buttons[] = {
|
||||
/* click event mask button function argument */
|
||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||
{ ClkWinTitle, 0, Button2, zoom, {0} },
|
||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||
{ ClkClientWin, MODKEY, Button1, movemouse, {0} },
|
||||
{ ClkClientWin, MODKEY, Button2, togglefloating, {0} },
|
||||
{ ClkClientWin, MODKEY, Button3, resizemouse, {0} },
|
||||
{ ClkTagBar, 0, Button1, view, {0} },
|
||||
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
||||
{ ClkTagBar, MODKEY, Button1, tag, {0} },
|
||||
{ ClkTagBar, MODKEY, Button3, toggletag, {0} },
|
||||
};
|
||||
|
11
config.def.h.rej
Executable file
11
config.def.h.rej
Executable file
@ -0,0 +1,11 @@
|
||||
--- config.def.h
|
||||
+++ config.def.h
|
||||
@@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
+static const int extrabarright = 0; /* 1 means extra bar text on right */
|
||||
+static const char statussep = ';'; /* separator between status bars */
|
||||
static const char *fonts[] = { "monospace:size=10" };
|
||||
static const char dmenufont[] = "monospace:size=10";
|
||||
static const char col_gray1[] = "#222222";
|
13
config.h
Normal file → Executable file
13
config.h
Normal file → Executable file
@ -4,11 +4,13 @@
|
||||
static const unsigned int borderpx = 2; /* border pixel of windows */
|
||||
static const unsigned int gappx = 5; /* gaps between windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const int swallowfloating = 0; /* 1 means swallow floating windows by default */
|
||||
static const int swallowfloating = 1; /* 1 means swallow floating windows by default */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
static const char *fonts[] = { "monospace:size=8" };
|
||||
static const char dmenufont[] = "monospace:size=8";
|
||||
static const int extrabarright = 0; /* 1 means extra bar text on right */
|
||||
static const char statussep = ';'; /* separator between status bars */
|
||||
static const char *fonts[] = { "Hermit:size=10" };
|
||||
static const char dmenufont[] = "Hermit:size=10";
|
||||
static const char col_gray1[] = "#222222";
|
||||
static const char col_gray2[] = "#444444";
|
||||
static const char col_gray3[] = "#bbbbbb";
|
||||
@ -22,7 +24,8 @@ static const char *colors[][3] = {
|
||||
/* fg bg border */
|
||||
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
|
||||
[SchemeSel] = { col_gray4, col_orange, col_orange },
|
||||
[SchemeStatus] = {col_gray3, col_gray1, "#000000"}, //Statusbar right {text, background, not used but must not be empty}
|
||||
//[SchemeStatus] = {col_gray3, col_gray1, "#000000"}, //Statusbar right {text, background, not used but must not be empty}
|
||||
[SchemeStatus] = {col_gray3, col_cyan, "#000000"},
|
||||
[SchemeTagsSel] = {col_gray4,col_cyan, "#000000"},
|
||||
[SchemeTagsNorm] = {col_gray3, col_gray1, "#000000"},
|
||||
[SchemeInfoSel] = {col_gray4, col_cyan, "#000000"},
|
||||
@ -30,7 +33,7 @@ static const char *colors[][3] = {
|
||||
};
|
||||
|
||||
/* tagging */
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
||||
static const char *tags[] = { " ", " ", " ", " ", " ", " ", " ", " ", " " };
|
||||
|
||||
static const Rule rules[] = {
|
||||
/* xprop(1):
|
||||
|
175
dwm-extrabar-6.2-20210209.diff
Executable file
175
dwm-extrabar-6.2-20210209.diff
Executable file
@ -0,0 +1,175 @@
|
||||
commit e8111727686dc5d8194ff95af70c3e4abcc2da54
|
||||
Author: Finn Rayment <finn@rayment.fr>
|
||||
Date: Tue Feb 9 16:33:51 2021 +0100
|
||||
|
||||
[PATCH] Updated extra bar support
|
||||
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 1c0b587..91593ee 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||
static const unsigned int snap = 32; /* snap pixel */
|
||||
static const int showbar = 1; /* 0 means no bar */
|
||||
static const int topbar = 1; /* 0 means bottom bar */
|
||||
+static const int extrabarright = 0; /* 1 means extra bar text on right */
|
||||
+static const char statussep = ';'; /* separator between status bars */
|
||||
static const char *fonts[] = { "monospace:size=10" };
|
||||
static const char dmenufont[] = "monospace:size=10";
|
||||
static const char col_gray1[] = "#222222";
|
||||
diff --git a/dwm.c b/dwm.c
|
||||
index 4465af1..3db6761 100644
|
||||
--- a/dwm.c
|
||||
+++ b/dwm.c
|
||||
@@ -117,6 +117,7 @@ struct Monitor {
|
||||
int nmaster;
|
||||
int num;
|
||||
int by; /* bar geometry */
|
||||
+ int eby; /* extra bar geometry */
|
||||
int mx, my, mw, mh; /* screen size */
|
||||
int wx, wy, ww, wh; /* window area */
|
||||
unsigned int seltags;
|
||||
@@ -129,6 +130,7 @@ struct Monitor {
|
||||
Client *stack;
|
||||
Monitor *next;
|
||||
Window barwin;
|
||||
+ Window extrabarwin;
|
||||
const Layout *lt[2];
|
||||
};
|
||||
|
||||
@@ -237,6 +239,7 @@ static void zoom(const Arg *arg);
|
||||
/* variables */
|
||||
static const char broken[] = "broken";
|
||||
static char stext[256];
|
||||
+static char estext[256];
|
||||
static int screen;
|
||||
static int sw, sh; /* X display screen geometry width, height */
|
||||
static int bh, blw = 0; /* bar geometry */
|
||||
@@ -505,7 +508,9 @@ cleanupmon(Monitor *mon)
|
||||
m->next = mon->next;
|
||||
}
|
||||
XUnmapWindow(dpy, mon->barwin);
|
||||
+ XUnmapWindow(dpy, mon->extrabarwin);
|
||||
XDestroyWindow(dpy, mon->barwin);
|
||||
+ XDestroyWindow(dpy, mon->extrabarwin);
|
||||
free(mon);
|
||||
}
|
||||
|
||||
@@ -568,6 +573,7 @@ configurenotify(XEvent *e)
|
||||
if (c->isfullscreen)
|
||||
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
||||
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
||||
+ XMoveResizeWindow(dpy, m->extrabarwin, m->wx, m->eby, m->ww, bh);
|
||||
}
|
||||
focus(NULL);
|
||||
arrange(NULL);
|
||||
@@ -740,6 +746,19 @@ drawbar(Monitor *m)
|
||||
}
|
||||
}
|
||||
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
|
||||
+
|
||||
+ if (m == selmon) { /* extra status is only drawn on selected monitor */
|
||||
+ drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
+ /* clear default bar draw buffer by drawing a blank rectangle */
|
||||
+ drw_rect(drw, 0, 0, m->ww, bh, 1, 1);
|
||||
+ if (extrabarright) {
|
||||
+ sw = TEXTW(estext) - lrpad + 2; /* 2px right padding */
|
||||
+ drw_text(drw, m->ww - sw, 0, sw, bh, 0, estext, 0);
|
||||
+ } else {
|
||||
+ drw_text(drw, 0, 0, mons->ww, bh, 0, estext, 0);
|
||||
+ }
|
||||
+ drw_map(drw, m->extrabarwin, 0, 0, m->ww, bh);
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1702,6 +1721,7 @@ togglebar(const Arg *arg)
|
||||
selmon->showbar = !selmon->showbar;
|
||||
updatebarpos(selmon);
|
||||
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
||||
+ XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
@@ -1809,14 +1829,22 @@ updatebars(void)
|
||||
};
|
||||
XClassHint ch = {"dwm", "dwm"};
|
||||
for (m = mons; m; m = m->next) {
|
||||
- if (m->barwin)
|
||||
- continue;
|
||||
- m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
||||
- CopyFromParent, DefaultVisual(dpy, screen),
|
||||
- CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||
- XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||
- XMapRaised(dpy, m->barwin);
|
||||
- XSetClassHint(dpy, m->barwin, &ch);
|
||||
+ if (!m->barwin) {
|
||||
+ m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
||||
+ CopyFromParent, DefaultVisual(dpy, screen),
|
||||
+ CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||
+ XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||
+ XMapRaised(dpy, m->barwin);
|
||||
+ XSetClassHint(dpy, m->barwin, &ch);
|
||||
+ }
|
||||
+ if (!m->extrabarwin) {
|
||||
+ m->extrabarwin = XCreateWindow(dpy, root, m->wx, m->eby, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
||||
+ CopyFromParent, DefaultVisual(dpy, screen),
|
||||
+ CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||
+ XDefineCursor(dpy, m->extrabarwin, cursor[CurNormal]->cursor);
|
||||
+ XMapRaised(dpy, m->extrabarwin);
|
||||
+ XSetClassHint(dpy, m->extrabarwin, &ch);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1825,12 +1853,15 @@ updatebarpos(Monitor *m)
|
||||
{
|
||||
m->wy = m->my;
|
||||
m->wh = m->mh;
|
||||
+ m->wh -= bh * m->showbar * 2;
|
||||
+ m->wy = m->showbar ? m->wy + bh : m->wy;
|
||||
if (m->showbar) {
|
||||
- m->wh -= bh;
|
||||
- m->by = m->topbar ? m->wy : m->wy + m->wh;
|
||||
- m->wy = m->topbar ? m->wy + bh : m->wy;
|
||||
- } else
|
||||
+ m->by = m->topbar ? m->wy - bh : m->wy + m->wh;
|
||||
+ m->eby = m->topbar ? m->wy + m->wh : m->wy - bh;
|
||||
+ } else {
|
||||
m->by = -bh;
|
||||
+ m->eby = -bh;
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1987,8 +2018,20 @@ updatesizehints(Client *c)
|
||||
void
|
||||
updatestatus(void)
|
||||
{
|
||||
- if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
|
||||
+ char text[512];
|
||||
+ if (!gettextprop(root, XA_WM_NAME, text, sizeof(text))) {
|
||||
strcpy(stext, "dwm-"VERSION);
|
||||
+ estext[0] = '\0';
|
||||
+ } else {
|
||||
+ char *e = strchr(text, statussep);
|
||||
+ if (e) {
|
||||
+ *e = '\0'; e++;
|
||||
+ strncpy(estext, e, sizeof(estext) - 1);
|
||||
+ } else {
|
||||
+ estext[0] = '\0';
|
||||
+ }
|
||||
+ strncpy(stext, text, sizeof(stext) - 1);
|
||||
+ }
|
||||
drawbar(selmon);
|
||||
}
|
||||
|
||||
@@ -2067,7 +2110,7 @@ wintomon(Window w)
|
||||
if (w == root && getrootptr(&x, &y))
|
||||
return recttomon(x, y, 1, 1);
|
||||
for (m = mons; m; m = m->next)
|
||||
- if (w == m->barwin)
|
||||
+ if (w == m->barwin || w == m->extrabarwin)
|
||||
return m;
|
||||
if ((c = wintoclient(w)))
|
||||
return c->mon;
|
82
dwm.c
Normal file → Executable file
82
dwm.c
Normal file → Executable file
@ -126,6 +126,7 @@ struct Monitor {
|
||||
int nmaster;
|
||||
int num;
|
||||
int by; /* bar geometry */
|
||||
int eby; /* extra bar geometry */
|
||||
int mx, my, mw, mh; /* screen size */
|
||||
int wx, wy, ww, wh; /* window area */
|
||||
int gappx; /* gaps between windows */
|
||||
@ -139,6 +140,7 @@ struct Monitor {
|
||||
Client *stack;
|
||||
Monitor *next;
|
||||
Window barwin;
|
||||
Window extrabarwin;
|
||||
const Layout *lt[2];
|
||||
};
|
||||
|
||||
@ -256,6 +258,7 @@ static pid_t winpid(Window w);
|
||||
/* variables */
|
||||
static const char broken[] = "broken";
|
||||
static char stext[256];
|
||||
static char estext[256];
|
||||
static int screen;
|
||||
static int sw, sh; /* X display screen geometry width, height */
|
||||
static int bh, blw = 0; /* bar geometry */
|
||||
@ -502,7 +505,7 @@ buttonpress(XEvent *e)
|
||||
if (ev->window == selmon->barwin) {
|
||||
i = x = 0;
|
||||
do
|
||||
x += TEXTW(tags[i]);
|
||||
x += bh;
|
||||
while (ev->x >= x && ++i < LENGTH(tags));
|
||||
if (i < LENGTH(tags)) {
|
||||
click = ClkTagBar;
|
||||
@ -575,7 +578,9 @@ cleanupmon(Monitor *mon)
|
||||
m->next = mon->next;
|
||||
}
|
||||
XUnmapWindow(dpy, mon->barwin);
|
||||
XUnmapWindow(dpy, mon->extrabarwin);
|
||||
XDestroyWindow(dpy, mon->barwin);
|
||||
XDestroyWindow(dpy, mon->extrabarwin);
|
||||
free(mon);
|
||||
}
|
||||
|
||||
@ -638,6 +643,7 @@ configurenotify(XEvent *e)
|
||||
if (c->isfullscreen)
|
||||
resizeclient(c, m->mx, m->my, m->mw, m->mh);
|
||||
XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
|
||||
XMoveResizeWindow(dpy, m->extrabarwin, m->wx, m->eby, m->ww, bh);
|
||||
}
|
||||
focus(NULL);
|
||||
arrange(NULL);
|
||||
@ -789,12 +795,12 @@ drawbar(Monitor *m)
|
||||
}
|
||||
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]);
|
||||
//w = TEXTW(tags[i]);
|
||||
w = bh;
|
||||
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]);
|
||||
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
|
||||
drw_text(drw, x, 0, bh, bh, 0, tags[i], urg & 1 << i);
|
||||
if (occ & 1 << i)
|
||||
drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw,
|
||||
drw_rect(drw, x + boxw, boxw, w - boxw*2, w - boxw*2,
|
||||
m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
|
||||
urg & 1 << i);
|
||||
|
||||
@ -817,6 +823,19 @@ drawbar(Monitor *m)
|
||||
}
|
||||
}
|
||||
drw_map(drw, m->barwin, 0, 0, m->ww, bh);
|
||||
|
||||
if (m == selmon) { /* extra status is only drawn on selected monitor */
|
||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||
/* clear default bar draw buffer by drawing a blank rectangle */
|
||||
drw_rect(drw, 0, 0, m->ww, bh, 1, 1);
|
||||
if (extrabarright) {
|
||||
sw = TEXTW(estext) - lrpad + 2; /* 2px right padding */
|
||||
drw_text(drw, m->ww - sw, 0, sw, bh, 0, estext, 0);
|
||||
} else {
|
||||
drw_text(drw, 0, 0, mons->ww, bh, 0, estext, 0);
|
||||
}
|
||||
drw_map(drw, m->extrabarwin, 0, 0, m->ww, bh);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -1793,6 +1812,7 @@ togglebar(const Arg *arg)
|
||||
selmon->showbar = !selmon->showbar;
|
||||
updatebarpos(selmon);
|
||||
XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
|
||||
XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh);
|
||||
arrange(selmon);
|
||||
}
|
||||
|
||||
@ -1917,14 +1937,22 @@ updatebars(void)
|
||||
};
|
||||
XClassHint ch = {"dwm", "dwm"};
|
||||
for (m = mons; m; m = m->next) {
|
||||
if (m->barwin)
|
||||
continue;
|
||||
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
||||
CopyFromParent, DefaultVisual(dpy, screen),
|
||||
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||
XMapRaised(dpy, m->barwin);
|
||||
XSetClassHint(dpy, m->barwin, &ch);
|
||||
if (!m->barwin) {
|
||||
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
||||
CopyFromParent, DefaultVisual(dpy, screen),
|
||||
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
|
||||
XMapRaised(dpy, m->barwin);
|
||||
XSetClassHint(dpy, m->barwin, &ch);
|
||||
}
|
||||
if (!m->extrabarwin) {
|
||||
m->extrabarwin = XCreateWindow(dpy, root, m->wx, m->eby, m->ww, bh, 0, DefaultDepth(dpy, screen),
|
||||
CopyFromParent, DefaultVisual(dpy, screen),
|
||||
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
|
||||
XDefineCursor(dpy, m->extrabarwin, cursor[CurNormal]->cursor);
|
||||
XMapRaised(dpy, m->extrabarwin);
|
||||
XSetClassHint(dpy, m->extrabarwin, &ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1933,12 +1961,15 @@ updatebarpos(Monitor *m)
|
||||
{
|
||||
m->wy = m->my;
|
||||
m->wh = m->mh;
|
||||
m->wh -= bh * m->showbar * 2;
|
||||
m->wy = m->showbar ? m->wy + bh : m->wy;
|
||||
if (m->showbar) {
|
||||
m->wh -= bh;
|
||||
m->by = m->topbar ? m->wy : m->wy + m->wh;
|
||||
m->wy = m->topbar ? m->wy + bh : m->wy;
|
||||
} else
|
||||
m->by = m->topbar ? m->wy - bh : m->wy + m->wh;
|
||||
m->eby = m->topbar ? m->wy + m->wh : m->wy - bh;
|
||||
} else {
|
||||
m->by = -bh;
|
||||
m->eby = -bh;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -2096,8 +2127,21 @@ void
|
||||
updatestatus(void)
|
||||
{
|
||||
Monitor* m;
|
||||
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
|
||||
char text[512];
|
||||
if (!gettextprop(root, XA_WM_NAME, text, sizeof(text))) {
|
||||
strcpy(stext, "dwm-"VERSION);
|
||||
estext[0] = '\0';
|
||||
} else {
|
||||
char *e = strchr(text, statussep);
|
||||
if (e) {
|
||||
*e = '\0'; e++;
|
||||
strncpy(estext, e, sizeof(estext) - 1);
|
||||
} else {
|
||||
estext[0] = '\0';
|
||||
}
|
||||
strncpy(stext, text, sizeof(stext) - 1);
|
||||
}
|
||||
|
||||
drawbar(selmon);
|
||||
for(m = mons; m; m = m->next)
|
||||
drawbar(m);
|
||||
@ -2308,7 +2352,7 @@ wintomon(Window w)
|
||||
if (w == root && getrootptr(&x, &y))
|
||||
return recttomon(x, y, 1, 1);
|
||||
for (m = mons; m; m = m->next)
|
||||
if (w == m->barwin)
|
||||
if (w == m->barwin || w == m->extrabarwin)
|
||||
return m;
|
||||
if ((c = wintoclient(w)))
|
||||
return c->mon;
|
||||
|
2392
dwm.c.orig
Executable file
2392
dwm.c.orig
Executable file
File diff suppressed because it is too large
Load Diff
24
dwm.c.rej
Executable file
24
dwm.c.rej
Executable file
@ -0,0 +1,24 @@
|
||||
--- dwm.c
|
||||
+++ dwm.c
|
||||
@@ -2018,8 +2049,20 @@ updatesizehints(Client *c)
|
||||
void
|
||||
updatestatus(void)
|
||||
{
|
||||
- if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
|
||||
+ char text[512];
|
||||
+ if (!gettextprop(root, XA_WM_NAME, text, sizeof(text))) {
|
||||
strcpy(stext, "dwm-"VERSION);
|
||||
+ estext[0] = '\0';
|
||||
+ } else {
|
||||
+ char *e = strchr(text, statussep);
|
||||
+ if (e) {
|
||||
+ *e = '\0'; e++;
|
||||
+ strncpy(estext, e, sizeof(estext) - 1);
|
||||
+ } else {
|
||||
+ estext[0] = '\0';
|
||||
+ }
|
||||
+ strncpy(stext, text, sizeof(stext) - 1);
|
||||
+ }
|
||||
drawbar(selmon);
|
||||
}
|
||||
|
0
dwm.png
Normal file → Executable file
0
dwm.png
Normal file → Executable file
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 373 B |
0
patches/.gitkeep
Normal file → Executable file
0
patches/.gitkeep
Normal file → Executable file
0
patches/dwm-activetagindicatorbar-6.2.diff
Normal file → Executable file
0
patches/dwm-activetagindicatorbar-6.2.diff
Normal file → Executable file
42
patches/dwm-blanktags-20210406-67d76bd.diff
Executable file
42
patches/dwm-blanktags-20210406-67d76bd.diff
Executable file
@ -0,0 +1,42 @@
|
||||
From 553c9f59f650c98d7782065b39725c9d2156c233 Mon Sep 17 00:00:00 2001
|
||||
From: DogeyStamp <adeng.sean@gmail.com>
|
||||
Date: Tue, 6 Apr 2021 18:28:50 -0400
|
||||
Subject: [PATCH] Remove tag numbers and center tag indicator
|
||||
|
||||
This patch makes tags square, removes the tag numbers, and centers the
|
||||
indicator showing a window is present so that the bar looks sleeker.
|
||||
---
|
||||
dwm.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dwm.c b/dwm.c
|
||||
index b0b3466..88aa701 100644
|
||||
--- a/dwm.c
|
||||
+++ b/dwm.c
|
||||
@@ -433,7 +433,7 @@ buttonpress(XEvent *e)
|
||||
if (ev->window == selmon->barwin) {
|
||||
i = x = 0;
|
||||
do
|
||||
- x += TEXTW(tags[i]);
|
||||
+ x += bh;
|
||||
while (ev->x >= x && ++i < LENGTH(tags));
|
||||
if (i < LENGTH(tags)) {
|
||||
click = ClkTagBar;
|
||||
@@ -716,11 +716,11 @@ drawbar(Monitor *m)
|
||||
}
|
||||
x = 0;
|
||||
for (i = 0; i < LENGTH(tags); i++) {
|
||||
- w = TEXTW(tags[i]);
|
||||
+ w = bh;
|
||||
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);
|
||||
+ drw_text(drw, x, 0, bh, bh, 0, "", urg & 1 << i);
|
||||
if (occ & 1 << i)
|
||||
- drw_rect(drw, x + boxs, boxs, boxw, boxw,
|
||||
+ drw_rect(drw, x+boxw,boxw, w-boxw*2, w-boxw*2,
|
||||
m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
|
||||
urg & 1 << i);
|
||||
x += w;
|
||||
--
|
||||
2.31.1
|
||||
|
0
patches/dwm-colorbar-6.2.diff
Normal file → Executable file
0
patches/dwm-colorbar-6.2.diff
Normal file → Executable file
0
patches/dwm-fullgaps-6.2.diff
Normal file → Executable file
0
patches/dwm-fullgaps-6.2.diff
Normal file → Executable file
0
patches/dwm-statusallmons-6.2.diff
Normal file → Executable file
0
patches/dwm-statusallmons-6.2.diff
Normal file → Executable file
0
patches/dwm-swallow-20201211-61bb8b2.diff
Normal file → Executable file
0
patches/dwm-swallow-20201211-61bb8b2.diff
Normal file → Executable file
0
shiftview.c
Normal file → Executable file
0
shiftview.c
Normal file → Executable file
0
transient.c
Normal file → Executable file
0
transient.c
Normal file → Executable file
Loading…
Reference in New Issue
Block a user