diff -Naur dwm-6.1/README dwm-6.1-bs/README --- dwm-6.1/README 2015-11-08 18:39:37.000000000 -0400 +++ dwm-6.1-bs/README 2018-03-16 21:05:31.276795730 -0400 @@ -10,8 +10,8 @@ Installation ------------ -Edit config.mk to match your local setup (dwm is installed into -the /usr/local namespace by default). +Edit config.mk to match your local setup (dwm is installed into the +/usr/local namespace by default). Afterwards enter the following command to build and install dwm (if necessary as root): @@ -19,7 +19,8 @@ make clean install If you are going to use the default bluegray color scheme it is highly -recommended to also install the bluegray files shipped in the dextra package. +recommended to also install the bluegray files shipped in the dextra +package. Running dwm @@ -28,15 +29,15 @@ exec dwm -In order to connect dwm to a specific display, make sure that -the DISPLAY environment variable is set correctly, e.g.: +In order to connect dwm to a specific display, make sure that the +DISPLAY environment variable is set correctly, e.g.: DISPLAY=foo.bar:1 exec dwm (This will start dwm on display :1 of the host foo.bar.) -In order to display status info in the bar, you can do something -like this in your .xinitrc: +In order to display status info in the bar, you can do something like +this in your .xinitrc: while xsetroot -name "`date` `uptime | sed 's/.*,//'`" do @@ -44,8 +45,20 @@ done & exec dwm - Configuration ------------- -The configuration of dwm is done by creating a custom config.h -and (re)compiling the source code. +The configuration of dwm is done by creating a custom config.h and +(re)compiling the source code. + +Extensions +---------- +Bottom_scratches is an optional numeric value that is useful if you +have a damage area in the bottom of your screen. For example, you can +bypass 128 pixels lines of your bottom screen by recompiling: + + BOTTOM_SCRATCHES=128 make install + +For sure you can compile as always if you don't wanna change anything. + + make install + diff -Naur dwm-6.1/config.def.h dwm-6.1-bs/config.def.h --- dwm-6.1/config.def.h 2015-11-08 18:39:37.000000000 -0400 +++ dwm-6.1-bs/config.def.h 2018-03-15 14:20:55.946487725 -0400 @@ -24,9 +24,12 @@ * WM_CLASS(STRING) = instance, class * WM_NAME(STRING) = title */ - /* class instance title tags mask isfloating monitor */ - { "Gimp", NULL, NULL, 0, 1, -1 }, - { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, + /* class instance title tags mask isfloating monitor */ + { "Gimp", NULL, NULL, 1 << 1, 1, -1 }, + { "rdesktop", NULL, NULL, 1 << 5, 0, -1 }, + { "vncviewer", NULL, NULL, 1 << 6, 0, -1 }, + { "Java", NULL, NULL, 1 << 7, 1, -1 }, + { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, }; /* layout(s) */ @@ -111,3 +114,10 @@ { ClkTagBar, MODKEY, Button3, toggletag, {0} }, }; +/* bypass scratches in the bottom */ +/* if you wanna exclude part of bottom screen area set botton_scratches > 0 */ +#ifdef _BOTTOM_SCRATCHES +static const int bottom_scratches = _BOTTOM_SCRATCHES; +#else +static const int bottom_scratches = 0; +#endif diff -Naur dwm-6.1/config.h dwm-6.1-bs/config.h --- dwm-6.1/config.h 1969-12-31 19:30:00.000000000 -0430 +++ dwm-6.1-bs/config.h 2018-03-15 14:20:55.946487725 -0400 @@ -0,0 +1,123 @@ +/* See LICENSE file for copyright and license details. */ + +/* appearance */ +static const char *fonts[] = { + "monospace:size=10" +}; +static const char dmenufont[] = "monospace:size=10"; +static const char normbordercolor[] = "#444444"; +static const char normbgcolor[] = "#222222"; +static const char normfgcolor[] = "#bbbbbb"; +static const char selbordercolor[] = "#005577"; +static const char selbgcolor[] = "#005577"; +static const char selfgcolor[] = "#eeeeee"; +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 */ + +/* 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 monitor */ + { "Gimp", NULL, NULL, 1 << 1, 1, -1 }, + { "rdesktop", NULL, NULL, 1 << 5, 0, -1 }, + { "vncviewer", NULL, NULL, 1 << 6, 0, -1 }, + { "Java", NULL, NULL, 1 << 7, 1, -1 }, + { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, +}; + +/* 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 Mod1Mask +#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", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; +static const char *termcmd[] = { "st", NULL }; + +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, XK_comma, focusmon, {.i = -1 } }, + { MODKEY, XK_period, focusmon, {.i = +1 } }, + { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, + { MODKEY|ShiftMask, XK_period, tagmon, {.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 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} }, +}; + +/* bypass scratches in the bottom */ +/* if you wanna exclude part of bottom screen area set botton_scratches > 0 */ +#ifdef _BOTTOM_SCRATCHES +static const int bottom_scratches = _BOTTOM_SCRATCHES; +#else +static const int bottom_scratches = 0; +#endif diff -Naur dwm-6.1/config.mk dwm-6.1-bs/config.mk --- dwm-6.1/config.mk 2015-11-08 18:39:37.000000000 -0400 +++ dwm-6.1-bs/config.mk 2018-03-13 20:15:49.517834352 -0400 @@ -24,8 +24,12 @@ INCS = -I${X11INC} -I${FREETYPEINC} LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} +ifndef BOTTOM_SCRATCHES +BOTTOM_SCRATCHES=0 +endif + # flags -CPPFLAGS = -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} +CPPFLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=2 -D_BOTTOM_SCRATCHES=${BOTTOM_SCRATCHES} -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} LDFLAGS = -s ${LIBS} diff -Naur dwm-6.1/dwm.c dwm-6.1-bs/dwm.c --- dwm-6.1/dwm.c 2015-11-08 18:39:37.000000000 -0400 +++ dwm-6.1-bs/dwm.c 2018-03-15 14:20:19.974519773 -0400 @@ -570,14 +570,14 @@ /* TODO: updategeom handling sucks, needs to be simplified */ if (ev->window == root) { - dirty = (sw != ev->width || sh != ev->height); + dirty = (sw != ev->width || sh != ev->height - bottom_scratches); sw = ev->width; sh = ev->height; if (updategeom() || dirty) { - drw_resize(drw, sw, bh); + drw_resize(drw, sw, bh); updatebars(); for (m = mons; m; m = m->next) - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); + XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); focus(NULL); arrange(NULL); } @@ -620,7 +620,7 @@ if ((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight))) configure(c); if (ISVISIBLE(c)) - XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); + XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); } else configure(c); } else { @@ -1286,7 +1286,13 @@ resize(Client *c, int x, int y, int w, int h, int interact) { if (applysizehints(c, &x, &y, &w, &h, interact)) - resizeclient(c, x, y, w, h); + resizeclient(c, x, y, w, h - bottom_scratches); + else + if (sh - bottom_scratches < c->h && c->isfloating) { + c->oldh = c->h; + c->h -= bottom_scratches; + resizeclient(c, x, y, w, c->h); + } } void