Compare commits
57 Commits
Author | SHA1 | Date | |
---|---|---|---|
93aeaa53c9 | |||
06f9f346e6 | |||
5c48012ad2 | |||
a686c9ccd2 | |||
9ca5c3b108 | |||
bab5b1178d | |||
ee8fb0c6e4 | |||
0d9d3e79e9 | |||
12280f0253 | |||
a58731e835 | |||
1df45593ed | |||
2122e39ce1 | |||
e70139428a | |||
3d1d75a224 | |||
35f08f4231 | |||
0ea0343a63 | |||
338c083858 | |||
671442e89d | |||
8d111632f5 | |||
fe5acb939a | |||
cac492b0e9 | |||
ef9b3e173c | |||
5a13632afb | |||
587100873a | |||
27b0595af7 | |||
12d5a26fd2 | |||
89b7f1503e | |||
5711609203 | |||
825b7c3eb1 | |||
ba96131af0 | |||
2c477cf661 | |||
986ca73074 | |||
288098893c | |||
cb9607c284 | |||
4bd4f421d3 | |||
84432e6b36 | |||
1a25414ace | |||
3171371498 | |||
92105e7862 | |||
6ee9f13457 | |||
352cae4380 | |||
b3b58c08e4 | |||
204f0a340d | |||
78666b99b8 | |||
0bdcf75e25 | |||
f1009285d8 | |||
f76b3a4685 | |||
84ae6e12eb | |||
784659565a | |||
7ae0c198b3 | |||
dc6623728d | |||
7541f1ad49 | |||
74cbbe5f35 | |||
52f0b9e2e3 | |||
29c26b88e7 | |||
f196b71e4d | |||
ab83872134 |
4
.hgtags
4
.hgtags
@ -37,3 +37,7 @@ d3876aa792923f9a95f7ad0c7f0134533404df35 3.2.2
|
|||||||
0f91934037b04221ff5d1ba3a6c39c1ff26e3661 3.3
|
0f91934037b04221ff5d1ba3a6c39c1ff26e3661 3.3
|
||||||
9ede7b2d2450537e750d5505789fbe63960e97e6 3.4
|
9ede7b2d2450537e750d5505789fbe63960e97e6 3.4
|
||||||
63ad05e7f9e1f4f1881fb02f529cb6c6ae81e693 3.5
|
63ad05e7f9e1f4f1881fb02f529cb6c6ae81e693 3.5
|
||||||
|
75b1b25fe0d7e29400baf30568153f668324928b 3.6
|
||||||
|
20ec6976cee1fcfee0c2f354ae382ee3f9f68efa 3.6.1
|
||||||
|
baee494346e520f8dee2cee9491b8350064770d2 3.7
|
||||||
|
2ea201354cf016407ea93e1e390d1422940d29b0 3.8
|
||||||
|
160
client.c
160
client.c
@ -83,24 +83,6 @@ setclientstate(Client *c, long state) {
|
|||||||
PropModeReplace, (unsigned char *)data, 2);
|
PropModeReplace, (unsigned char *)data, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
togglemax(Client *c) {
|
|
||||||
XEvent ev;
|
|
||||||
|
|
||||||
if(c->isfixed)
|
|
||||||
return;
|
|
||||||
if((c->ismax = !c->ismax)) {
|
|
||||||
c->rx = c->x;
|
|
||||||
c->ry = c->y;
|
|
||||||
c->rw = c->w;
|
|
||||||
c->rh = c->h;
|
|
||||||
resize(c, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX, True);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
resize(c, c->rx, c->ry, c->rw, c->rh, True);
|
|
||||||
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xerrordummy(Display *dsply, XErrorEvent *ee) {
|
xerrordummy(Display *dsply, XErrorEvent *ee) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -171,43 +153,20 @@ focus(Client *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
focusnext(Arg *arg) {
|
killclient(const char *arg) {
|
||||||
Client *c;
|
XEvent ev;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
for(c = sel->next; c && !isvisible(c); c = c->next);
|
if(isprotodel(sel)) {
|
||||||
if(!c)
|
ev.type = ClientMessage;
|
||||||
for(c = clients; c && !isvisible(c); c = c->next);
|
ev.xclient.window = sel->win;
|
||||||
if(c) {
|
ev.xclient.message_type = wmatom[WMProtocols];
|
||||||
focus(c);
|
ev.xclient.format = 32;
|
||||||
restack();
|
ev.xclient.data.l[0] = wmatom[WMDelete];
|
||||||
|
ev.xclient.data.l[1] = CurrentTime;
|
||||||
|
XSendEvent(dpy, sel->win, False, NoEventMask, &ev);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
focusprev(Arg *arg) {
|
|
||||||
Client *c;
|
|
||||||
|
|
||||||
if(!sel)
|
|
||||||
return;
|
|
||||||
for(c = sel->prev; c && !isvisible(c); c = c->prev);
|
|
||||||
if(!c) {
|
|
||||||
for(c = clients; c && c->next; c = c->next);
|
|
||||||
for(; c && !isvisible(c); c = c->prev);
|
|
||||||
}
|
|
||||||
if(c) {
|
|
||||||
focus(c);
|
|
||||||
restack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
killclient(Arg *arg) {
|
|
||||||
if(!sel)
|
|
||||||
return;
|
|
||||||
if(isprotodel(sel))
|
|
||||||
sendevent(sel->win, wmatom[WMProtocols], wmatom[WMDelete]);
|
|
||||||
else
|
else
|
||||||
XKillClient(dpy, sel->win);
|
XKillClient(dpy, sel->win);
|
||||||
}
|
}
|
||||||
@ -253,8 +212,8 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
updatetitle(c);
|
updatetitle(c);
|
||||||
for(t = clients; t && t->win != trans; t = t->next);
|
for(t = clients; t && t->win != trans; t = t->next);
|
||||||
settags(c, t);
|
settags(c, t);
|
||||||
if(!c->isversatile)
|
if(!c->isfloating)
|
||||||
c->isversatile = (t != NULL) || c->isfixed;
|
c->isfloating = (t != NULL) || c->isfixed;
|
||||||
attach(c);
|
attach(c);
|
||||||
attachstack(c);
|
attachstack(c);
|
||||||
c->isbanned = True;
|
c->isbanned = True;
|
||||||
@ -266,20 +225,35 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
lt->arrange();
|
lt->arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
Client *
|
|
||||||
nexttiled(Client *c) {
|
|
||||||
for(; c && (c->isversatile || !isvisible(c)); c = c->next);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
||||||
float actual, dx, dy, max, min;
|
float dx, dy, max, min, ratio;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
|
|
||||||
if(w <= 0 || h <= 0)
|
if(w <= 0 || h <= 0)
|
||||||
return;
|
return;
|
||||||
if(sizehints) {
|
if(sizehints) {
|
||||||
|
if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0) {
|
||||||
|
dx = (float)(w - c->basew);
|
||||||
|
dy = (float)(h - c->baseh);
|
||||||
|
min = (float)(c->minax) / (float)(c->minay);
|
||||||
|
max = (float)(c->maxax) / (float)(c->maxay);
|
||||||
|
ratio = dx / dy;
|
||||||
|
if(max > 0 && min > 0 && ratio > 0) {
|
||||||
|
if(ratio < min) {
|
||||||
|
dy = (dx * min + dy) / (min * min + 1);
|
||||||
|
dx = dy * min;
|
||||||
|
w = (int)dx + c->basew;
|
||||||
|
h = (int)dy + c->baseh;
|
||||||
|
}
|
||||||
|
else if(ratio > max) {
|
||||||
|
dy = (dx * min + dy) / (max * max + 1);
|
||||||
|
dx = dy * min;
|
||||||
|
w = (int)dx + c->basew;
|
||||||
|
h = (int)dy + c->baseh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(c->minw && w < c->minw)
|
if(c->minw && w < c->minw)
|
||||||
w = c->minw;
|
w = c->minw;
|
||||||
if(c->minh && h < c->minh)
|
if(c->minh && h < c->minh)
|
||||||
@ -288,33 +262,13 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
|||||||
w = c->maxw;
|
w = c->maxw;
|
||||||
if(c->maxh && h > c->maxh)
|
if(c->maxh && h > c->maxh)
|
||||||
h = c->maxh;
|
h = c->maxh;
|
||||||
/* inspired by algorithm from fluxbox */
|
|
||||||
if(c->minay > 0 && c->maxay && (h - c->baseh) > 0) {
|
|
||||||
dx = (float)(w - c->basew);
|
|
||||||
dy = (float)(h - c->baseh);
|
|
||||||
min = (float)(c->minax) / (float)(c->minay);
|
|
||||||
max = (float)(c->maxax) / (float)(c->maxay);
|
|
||||||
actual = dx / dy;
|
|
||||||
if(max > 0 && min > 0 && actual > 0) {
|
|
||||||
if(actual < min) {
|
|
||||||
dy = (dx * min + dy) / (min * min + 1);
|
|
||||||
dx = dy * min;
|
|
||||||
w = (int)dx + c->basew;
|
|
||||||
h = (int)dy + c->baseh;
|
|
||||||
}
|
|
||||||
else if(actual > max) {
|
|
||||||
dy = (dx * min + dy) / (max * max + 1);
|
|
||||||
dx = dy * min;
|
|
||||||
w = (int)dx + c->basew;
|
|
||||||
h = (int)dy + c->baseh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(c->incw)
|
if(c->incw)
|
||||||
w -= (w - c->basew) % c->incw;
|
w -= (w - c->basew) % c->incw;
|
||||||
if(c->inch)
|
if(c->inch)
|
||||||
h -= (h - c->baseh) % c->inch;
|
h -= (h - c->baseh) % c->inch;
|
||||||
}
|
}
|
||||||
|
if(w <= 0 || h <= 0)
|
||||||
|
return;
|
||||||
if(w == sw && h == sh)
|
if(w == sw && h == sh)
|
||||||
c->border = 0;
|
c->border = 0;
|
||||||
else
|
else
|
||||||
@ -340,6 +294,14 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
togglefloating(const char *arg) {
|
||||||
|
if(!sel || lt->arrange == floating)
|
||||||
|
return;
|
||||||
|
sel->isfloating = !sel->isfloating;
|
||||||
|
lt->arrange();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
updatesizehints(Client *c) {
|
updatesizehints(Client *c) {
|
||||||
long msize;
|
long msize;
|
||||||
@ -352,6 +314,10 @@ updatesizehints(Client *c) {
|
|||||||
c->basew = size.base_width;
|
c->basew = size.base_width;
|
||||||
c->baseh = size.base_height;
|
c->baseh = size.base_height;
|
||||||
}
|
}
|
||||||
|
else if(c->flags & PMinSize) {
|
||||||
|
c->basew = size.min_width;
|
||||||
|
c->baseh = size.min_height;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
c->basew = c->baseh = 0;
|
c->basew = c->baseh = 0;
|
||||||
if(c->flags & PResizeInc) {
|
if(c->flags & PResizeInc) {
|
||||||
@ -370,16 +336,20 @@ updatesizehints(Client *c) {
|
|||||||
c->minw = size.min_width;
|
c->minw = size.min_width;
|
||||||
c->minh = size.min_height;
|
c->minh = size.min_height;
|
||||||
}
|
}
|
||||||
|
else if(c->flags & PBaseSize) {
|
||||||
|
c->minw = size.base_width;
|
||||||
|
c->minh = size.base_height;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
c->minw = c->minh = 0;
|
c->minw = c->minh = 0;
|
||||||
if(c->flags & PAspect) {
|
if(c->flags & PAspect) {
|
||||||
c->minax = size.min_aspect.x;
|
c->minax = size.min_aspect.x;
|
||||||
c->minay = size.min_aspect.y;
|
|
||||||
c->maxax = size.max_aspect.x;
|
c->maxax = size.max_aspect.x;
|
||||||
|
c->minay = size.min_aspect.y;
|
||||||
c->maxay = size.max_aspect.y;
|
c->maxay = size.max_aspect.y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c->minax = c->minay = c->maxax = c->maxay = 0;
|
c->minax = c->maxax = c->minay = c->maxay = 0;
|
||||||
c->isfixed = (c->maxw && c->minw && c->maxh && c->minh
|
c->isfixed = (c->maxw && c->minw && c->maxh && c->minh
|
||||||
&& c->maxw == c->minw && c->maxh == c->minh);
|
&& c->maxw == c->minw && c->maxh == c->minh);
|
||||||
}
|
}
|
||||||
@ -432,25 +402,3 @@ unmanage(Client *c) {
|
|||||||
XUngrabServer(dpy);
|
XUngrabServer(dpy);
|
||||||
lt->arrange();
|
lt->arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
zoom(Arg *arg) {
|
|
||||||
unsigned int n;
|
|
||||||
Client *c;
|
|
||||||
|
|
||||||
if(!sel)
|
|
||||||
return;
|
|
||||||
if(sel->isversatile || (lt->arrange == versatile)) {
|
|
||||||
togglemax(sel);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
|
|
||||||
n++;
|
|
||||||
if((c = sel) == nexttiled(clients))
|
|
||||||
if(!(c = nexttiled(c->next)))
|
|
||||||
return;
|
|
||||||
detach(c);
|
|
||||||
attach(c);
|
|
||||||
focus(c);
|
|
||||||
lt->arrange();
|
|
||||||
}
|
|
||||||
|
154
config.arg.h
154
config.arg.h
@ -2,96 +2,98 @@
|
|||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* appearance */
|
||||||
#define BORDERPX 1
|
#define BORDERPX 1
|
||||||
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
|
#define FONT "-*-proggyclean-medium-r-*-*-13-*-*-*-*-*-*-*"
|
||||||
#define NORMBORDERCOLOR "#333"
|
#define NORMBORDERCOLOR "#333"
|
||||||
#define NORMBGCOLOR "#222"
|
#define NORMBGCOLOR "#222"
|
||||||
#define NORMFGCOLOR "#ccc"
|
#define NORMFGCOLOR "#ccc"
|
||||||
#define SELBORDERCOLOR "#69c"
|
#define SELBORDERCOLOR "#8c8"
|
||||||
#define SELBGCOLOR "#555"
|
#define SELBGCOLOR "#555"
|
||||||
#define SELFGCOLOR "#fff"
|
#define SELFGCOLOR "#fff"
|
||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
|
||||||
#define MODKEY Mod1Mask
|
|
||||||
#define NMASTER 1 /* clients in master area */
|
|
||||||
#define SNAP 40 /* pixel */
|
|
||||||
#define TOPBAR True /* False */
|
#define TOPBAR True /* False */
|
||||||
|
|
||||||
|
/* tagging */
|
||||||
#define TAGS \
|
#define TAGS \
|
||||||
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
||||||
|
|
||||||
#define LAYOUTS \
|
|
||||||
static Layout layout[] = { \
|
|
||||||
/* symbol function */ \
|
|
||||||
{ "[]=", tile }, /* first entry is default */ \
|
|
||||||
{ "><>", versatile }, \
|
|
||||||
};
|
|
||||||
|
|
||||||
#define KEYS \
|
|
||||||
static Key key[] = { \
|
|
||||||
/* modifier key function argument */ \
|
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, \
|
|
||||||
{ .cmd = "exec uxterm -bg '#222' -fg '#eee' -cr '#eee' +sb -fn '"FONT"'" } }, \
|
|
||||||
{ MODKEY, XK_p, spawn, \
|
|
||||||
{ .cmd = "exe=\"$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u " \
|
|
||||||
" | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' " \
|
|
||||||
"-sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"')\" && exec $exe" } }, \
|
|
||||||
{ MODKEY, XK_j, focusnext, { 0 } }, \
|
|
||||||
{ MODKEY, XK_k, focusprev, { 0 } }, \
|
|
||||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
|
||||||
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
|
||||||
{ MODKEY, XK_s, resizemaster, { .i = -15 } }, \
|
|
||||||
{ MODKEY, XK_i, incnmaster, { .i = 1 } }, \
|
|
||||||
{ MODKEY, XK_d, incnmaster, { .i = -1 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, { .i = -1 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_5, tag, { .i = 4 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_6, tag, { .i = 5 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_7, tag, { .i = 6 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_8, tag, { .i = 7 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_9, tag, { .i = 8 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_6, toggletag, { .i = 5 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_7, toggletag, { .i = 6 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag, { .i = 7 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag, { .i = 8 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
|
||||||
{ MODKEY, XK_space, setlayout, { .i = -1 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_space, toggleversatile,{ 0 } }, \
|
|
||||||
{ MODKEY, XK_0, view, { .i = -1 } }, \
|
|
||||||
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
|
||||||
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
|
||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
|
||||||
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
|
||||||
{ MODKEY, XK_5, view, { .i = 4 } }, \
|
|
||||||
{ MODKEY, XK_6, view, { .i = 5 } }, \
|
|
||||||
{ MODKEY, XK_7, view, { .i = 6 } }, \
|
|
||||||
{ MODKEY, XK_8, view, { .i = 7 } }, \
|
|
||||||
{ MODKEY, XK_9, view, { .i = 8 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_5, toggleview, { .i = 4 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_6, toggleview, { .i = 5 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_7, toggleview, { .i = 6 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_8, toggleview, { .i = 7 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
|
||||||
};
|
|
||||||
|
|
||||||
#define RULES \
|
#define RULES \
|
||||||
static Rule rule[] = { \
|
static Rule rule[] = { \
|
||||||
/* class:instance:title regex tags regex isversatile */ \
|
/* class:instance:title regex tags regex isfloating */ \
|
||||||
{ "Firefox", "3", False }, \
|
{ "Firefox", "3", False }, \
|
||||||
{ "Gimp", NULL, True }, \
|
{ "Gimp", NULL, True }, \
|
||||||
{ "MPlayer", NULL, True }, \
|
{ "MPlayer", NULL, True }, \
|
||||||
{ "Acroread", NULL, True }, \
|
{ "Acroread", NULL, True }, \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* layout(s) */
|
||||||
|
#define LAYOUTS \
|
||||||
|
static Layout layout[] = { \
|
||||||
|
/* symbol function */ \
|
||||||
|
{ "[]=", tile }, /* first entry is default */ \
|
||||||
|
{ "><>", floating }, \
|
||||||
|
};
|
||||||
|
#define MASTERWIDTH 600 /* master width per thousand */
|
||||||
|
#define NMASTER 1 /* clients in master area */
|
||||||
|
#define SNAP 32 /* snap pixel */
|
||||||
|
|
||||||
|
/* key definitions */
|
||||||
|
#define MODKEY Mod1Mask
|
||||||
|
#define KEYS \
|
||||||
|
static Key key[] = { \
|
||||||
|
/* modifier key function argument */ \
|
||||||
|
{ MODKEY, XK_p, spawn, \
|
||||||
|
"exe=`dmenu_path | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"'" \
|
||||||
|
" -sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"'` && exec $exe" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_Return, spawn, \
|
||||||
|
"exec urxvtcd -tr -bg '#222' -fg '#eee' -cr '#eee' +sb -fn '"FONT"'" }, \
|
||||||
|
{ MODKEY, XK_space, setlayout, NULL }, \
|
||||||
|
{ MODKEY, XK_h, incmasterw, "-32" }, \
|
||||||
|
{ MODKEY, XK_l, incmasterw, "32" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_j, incnmaster, "1" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_k, incnmaster, "-1" }, \
|
||||||
|
{ MODKEY, XK_j, focusclient, "1" }, \
|
||||||
|
{ MODKEY, XK_k, focusclient, "-1" }, \
|
||||||
|
{ MODKEY, XK_m, togglemax, NULL }, \
|
||||||
|
{ MODKEY, XK_Return, zoom, NULL }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_c, killclient, NULL }, \
|
||||||
|
{ MODKEY, XK_0, view, NULL }, \
|
||||||
|
{ MODKEY, XK_1, view, "0" }, \
|
||||||
|
{ MODKEY, XK_2, view, "1" }, \
|
||||||
|
{ MODKEY, XK_3, view, "2" }, \
|
||||||
|
{ MODKEY, XK_4, view, "3" }, \
|
||||||
|
{ MODKEY, XK_5, view, "4" }, \
|
||||||
|
{ MODKEY, XK_6, view, "5" }, \
|
||||||
|
{ MODKEY, XK_7, view, "6" }, \
|
||||||
|
{ MODKEY, XK_8, view, "7" }, \
|
||||||
|
{ MODKEY, XK_9, view, "8" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_1, toggleview, "0" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_2, toggleview, "1" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_3, toggleview, "2" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_4, toggleview, "3" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_5, toggleview, "4" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_6, toggleview, "5" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_7, toggleview, "6" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_8, toggleview, "7" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_9, toggleview, "8" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_0, tag, NULL }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_1, tag, "0" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_2, tag, "1" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_3, tag, "2" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_4, tag, "3" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_5, tag, "4" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_6, tag, "5" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_7, tag, "6" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_8, tag, "7" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_9, tag, "8" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, "0" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, "1" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, "2" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, "3" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, "4" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_6, toggletag, "5" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_7, toggletag, "6" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag, "7" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag, "8" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_q, quit, NULL }, \
|
||||||
|
};
|
||||||
|
142
config.default.h
142
config.default.h
@ -2,6 +2,7 @@
|
|||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* appearance */
|
||||||
#define BORDERPX 1
|
#define BORDERPX 1
|
||||||
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
|
||||||
#define NORMBORDERCOLOR "#dddddd"
|
#define NORMBORDERCOLOR "#dddddd"
|
||||||
@ -10,84 +11,87 @@
|
|||||||
#define SELBORDERCOLOR "#ff0000"
|
#define SELBORDERCOLOR "#ff0000"
|
||||||
#define SELBGCOLOR "#006699"
|
#define SELBGCOLOR "#006699"
|
||||||
#define SELFGCOLOR "#ffffff"
|
#define SELFGCOLOR "#ffffff"
|
||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
|
||||||
#define MODKEY Mod1Mask
|
|
||||||
#define NMASTER 1 /* clients in master area */
|
|
||||||
#define SNAP 20 /* pixel */
|
|
||||||
#define TOPBAR True /* False */
|
#define TOPBAR True /* False */
|
||||||
|
|
||||||
|
/* tagging */
|
||||||
#define TAGS \
|
#define TAGS \
|
||||||
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
||||||
|
|
||||||
#define LAYOUTS \
|
|
||||||
Layout layout[] = { \
|
|
||||||
/* symbol function */ \
|
|
||||||
{ "[]=", tile }, /* first entry is default */ \
|
|
||||||
{ "><>", versatile }, \
|
|
||||||
};
|
|
||||||
|
|
||||||
#define KEYS \
|
|
||||||
static Key key[] = { \
|
|
||||||
/* modifier key function argument */ \
|
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, { .cmd = "exec xterm" } }, \
|
|
||||||
{ MODKEY, XK_Tab, focusnext, { 0 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_Tab, focusprev, { 0 } }, \
|
|
||||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
|
||||||
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
|
||||||
{ MODKEY, XK_s, resizemaster, { .i = -15 } }, \
|
|
||||||
{ MODKEY, XK_i, incnmaster, { .i = 1 } }, \
|
|
||||||
{ MODKEY, XK_d, incnmaster, { .i = -1 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, { .i = -1 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_5, tag, { .i = 4 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_6, tag, { .i = 5 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_7, tag, { .i = 6 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_8, tag, { .i = 7 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_9, tag, { .i = 8 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_6, toggletag, { .i = 5 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_7, toggletag, { .i = 6 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag, { .i = 7 } }, \
|
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag, { .i = 8 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
|
||||||
{ MODKEY, XK_space, setlayout, { .i = -1 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_space, toggleversatile,{ 0 } }, \
|
|
||||||
{ MODKEY, XK_0, view, { .i = -1 } }, \
|
|
||||||
{ MODKEY, XK_1, view, { .i = 0 } }, \
|
|
||||||
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
|
||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
|
||||||
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
|
||||||
{ MODKEY, XK_5, view, { .i = 4 } }, \
|
|
||||||
{ MODKEY, XK_6, view, { .i = 5 } }, \
|
|
||||||
{ MODKEY, XK_7, view, { .i = 6 } }, \
|
|
||||||
{ MODKEY, XK_8, view, { .i = 7 } }, \
|
|
||||||
{ MODKEY, XK_9, view, { .i = 8 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_5, toggleview, { .i = 4 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_6, toggleview, { .i = 5 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_7, toggleview, { .i = 6 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_8, toggleview, { .i = 7 } }, \
|
|
||||||
{ MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
|
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Query class:instance:title for regex matching info with following command:
|
/* Query class:instance:title for regex matching info with following command:
|
||||||
* xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
|
* xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
|
||||||
#define RULES \
|
#define RULES \
|
||||||
static Rule rule[] = { \
|
static Rule rule[] = { \
|
||||||
/* class:instance:title regex tags regex isversatile */ \
|
/* class:instance:title regex tags regex isfloating */ \
|
||||||
{ "Gimp", NULL, True }, \
|
{ "Gimp", NULL, True }, \
|
||||||
{ "MPlayer", NULL, True }, \
|
{ "MPlayer", NULL, True }, \
|
||||||
{ "Acroread", NULL, True }, \
|
{ "Acroread", NULL, True }, \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* layout(s) */
|
||||||
|
#define LAYOUTS \
|
||||||
|
static Layout layout[] = { \
|
||||||
|
/* symbol function */ \
|
||||||
|
{ "[]=", tile }, /* first entry is default */ \
|
||||||
|
{ "><>", floating }, \
|
||||||
|
};
|
||||||
|
#define MASTERWIDTH 600 /* master width per thousand */
|
||||||
|
#define NMASTER 1 /* clients in master area */
|
||||||
|
#define SNAP 32 /* snap pixel */
|
||||||
|
|
||||||
|
/* key definitions */
|
||||||
|
#define MODKEY Mod1Mask
|
||||||
|
#define KEYS \
|
||||||
|
static Key key[] = { \
|
||||||
|
/* modifier key function argument */ \
|
||||||
|
{ MODKEY|ShiftMask, XK_Return, spawn, "exec xterm" }, \
|
||||||
|
{ MODKEY, XK_p, spawn, "exe=`dmenu_path | dmenu` && exec $exe" }, \
|
||||||
|
{ MODKEY, XK_space, setlayout, NULL }, \
|
||||||
|
{ MODKEY, XK_h, incmasterw, "-32" }, \
|
||||||
|
{ MODKEY, XK_l, incmasterw, "32" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_j, incnmaster, "1" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_k, incnmaster, "-1" }, \
|
||||||
|
{ MODKEY, XK_j, focusclient, "1" }, \
|
||||||
|
{ MODKEY, XK_k, focusclient, "-1" }, \
|
||||||
|
{ MODKEY, XK_m, togglemax, NULL }, \
|
||||||
|
{ MODKEY, XK_Return, zoom, NULL }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_c, killclient, NULL }, \
|
||||||
|
{ MODKEY, XK_0, view, NULL }, \
|
||||||
|
{ MODKEY, XK_1, view, "0" }, \
|
||||||
|
{ MODKEY, XK_2, view, "1" }, \
|
||||||
|
{ MODKEY, XK_3, view, "2" }, \
|
||||||
|
{ MODKEY, XK_4, view, "3" }, \
|
||||||
|
{ MODKEY, XK_5, view, "4" }, \
|
||||||
|
{ MODKEY, XK_6, view, "5" }, \
|
||||||
|
{ MODKEY, XK_7, view, "6" }, \
|
||||||
|
{ MODKEY, XK_8, view, "7" }, \
|
||||||
|
{ MODKEY, XK_9, view, "8" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_1, toggleview, "0" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_2, toggleview, "1" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_3, toggleview, "2" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_4, toggleview, "3" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_5, toggleview, "4" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_6, toggleview, "5" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_7, toggleview, "6" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_8, toggleview, "7" }, \
|
||||||
|
{ MODKEY|ControlMask, XK_9, toggleview, "8" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_0, tag, NULL }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_1, tag, "0" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_2, tag, "1" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_3, tag, "2" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_4, tag, "3" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_5, tag, "4" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_6, tag, "5" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_7, tag, "6" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_8, tag, "7" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_9, tag, "8" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, "0" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, "1" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, "2" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, "3" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, "4" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_6, toggletag, "5" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_7, toggletag, "6" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_8, toggletag, "7" }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_9, toggletag, "8" }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_q, quit, NULL }, \
|
||||||
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# dwm version
|
# dwm version
|
||||||
VERSION = 3.6
|
VERSION = 3.9
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
|
19
draw.c
19
draw.c
@ -79,7 +79,12 @@ drawstatus(void) {
|
|||||||
drawtext(stext, dc.norm);
|
drawtext(stext, dc.norm);
|
||||||
if((dc.w = dc.x - x) > bh) {
|
if((dc.w = dc.x - x) > bh) {
|
||||||
dc.x = x;
|
dc.x = x;
|
||||||
drawtext(sel ? sel->name : NULL, sel ? dc.sel : dc.norm);
|
if(sel) {
|
||||||
|
drawtext(sel->name, dc.sel);
|
||||||
|
drawsquare(sel->ismax, sel->isfloating, dc.sel);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
drawtext(NULL, dc.norm);
|
||||||
}
|
}
|
||||||
XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, sw, bh, 0, 0);
|
XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, sw, bh, 0, 0);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
@ -90,7 +95,6 @@ drawtext(const char *text, unsigned long col[ColLast]) {
|
|||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
static char buf[256];
|
static char buf[256];
|
||||||
unsigned int len, olen;
|
unsigned int len, olen;
|
||||||
XGCValues gcv;
|
|
||||||
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
|
XRectangle r = { dc.x, dc.y, dc.w, dc.h };
|
||||||
|
|
||||||
XSetForeground(dpy, dc.gc, col[ColBG]);
|
XSetForeground(dpy, dc.gc, col[ColBG]);
|
||||||
@ -119,16 +123,11 @@ drawtext(const char *text, unsigned long col[ColLast]) {
|
|||||||
}
|
}
|
||||||
if(w > dc.w)
|
if(w > dc.w)
|
||||||
return; /* too long */
|
return; /* too long */
|
||||||
gcv.foreground = col[ColFG];
|
XSetForeground(dpy, dc.gc, col[ColFG]);
|
||||||
if(dc.font.set) {
|
if(dc.font.set)
|
||||||
XChangeGC(dpy, dc.gc, GCForeground, &gcv);
|
|
||||||
XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
|
XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
gcv.font = dc.font.xfont->fid;
|
|
||||||
XChangeGC(dpy, dc.gc, GCForeground | GCFont, &gcv);
|
|
||||||
XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
|
XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
|
103
dwm.1
103
dwm.1
@ -1,29 +1,31 @@
|
|||||||
.TH DWM 1 dwm-VERSION
|
.TH DWM 1 dwm\-VERSION
|
||||||
.SH NAME
|
.SH NAME
|
||||||
dwm \- dynamic window manager
|
dwm \- dynamic window manager
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B dwm
|
.B dwm
|
||||||
.RB [ \-v ]
|
.RB [ \-v ]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
dwm is a dynamic window manager for X. It manages windows in tiling and
|
dwm is a dynamic window manager for X. It manages windows in tiled and
|
||||||
versatile layouts. Either layout can be applied dynamically, optimizing the
|
floating layouts. Either layout can be applied dynamically, optimizing the
|
||||||
environment for the application in use and the task performed.
|
environment for the application in use and the task performed.
|
||||||
.P
|
.P
|
||||||
In tiling layout windows are managed in a master and stacking area. The master
|
In tiled layout windows are managed in a master and stacking area. The master
|
||||||
area contains the windows which currently need most attention, whereas the
|
area contains the windows which currently need most attention, whereas the
|
||||||
stacking area contains all other windows. In versatile layout windows can be
|
stacking area contains all other windows. In floating layout windows can be
|
||||||
resized and moved freely. Dialog windows are always managed versatile,
|
resized and moved freely. Dialog windows are always managed floating,
|
||||||
regardless of the layout applied.
|
regardless of the layout applied.
|
||||||
.P
|
.P
|
||||||
Windows are grouped by tags. Each window can be tagged with one or multiple
|
Windows are grouped by tags. Each window can be tagged with one or multiple
|
||||||
tags. Selecting certain tags displays all windows with these tags.
|
tags. Selecting certain tags displays all windows with these tags.
|
||||||
.P
|
.P
|
||||||
dwm contains a small status bar which displays all available tags, the layout,
|
dwm contains a small status bar which displays all available tags, the layout,
|
||||||
the title of the focused window, and the text read from standard input. The
|
the title of the focused window, and the text read from standard input. A
|
||||||
selected tags are indicated with a different color. The tags of the focused
|
floating window is indicated with an empty square and a maximized
|
||||||
window are indicated with a filled square in the top left corner. The tags
|
floating window is indicated with a filled square before the windows
|
||||||
which are applied to one or more windows are indicated with an empty square in
|
title. The selected tags are indicated with a different color. The tags of
|
||||||
the top left corner.
|
the focused window are indicated with a filled square in the top left
|
||||||
|
corner. The tags which are applied to one or more windows are indicated
|
||||||
|
with an empty square in the top left corner.
|
||||||
.P
|
.P
|
||||||
dwm draws a small border around windows to indicate the focus state.
|
dwm draws a small border around windows to indicate the focus state.
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
@ -38,96 +40,93 @@ is read and displayed in the status text area.
|
|||||||
.TP
|
.TP
|
||||||
.B Button1
|
.B Button1
|
||||||
click on a tag label to display all windows with that tag, click on the layout
|
click on a tag label to display all windows with that tag, click on the layout
|
||||||
label toggles between tiling and versatile layout.
|
label toggles between tiled and floating layout.
|
||||||
.TP
|
.TP
|
||||||
.B Button3
|
.B Button3
|
||||||
click on a tag label adds/removes all windows with that tag to/from the view.
|
click on a tag label adds/removes all windows with that tag to/from the view.
|
||||||
.TP
|
.TP
|
||||||
.B Button4
|
.B Mod1\-Button1
|
||||||
click on the layout label increases the number of windows in the master area (tiling layout only).
|
|
||||||
.TP
|
|
||||||
.B Button5
|
|
||||||
click on the layout label decreases the number of windows in the master area (tiling layout only).
|
|
||||||
.TP
|
|
||||||
.B Mod1-Button1
|
|
||||||
click on a tag label applies that tag to the focused window.
|
click on a tag label applies that tag to the focused window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Button3
|
.B Mod1\-Button3
|
||||||
click on a tag label adds/removes that tag to/from the focused window.
|
click on a tag label adds/removes that tag to/from the focused window.
|
||||||
.SS Keyboard commands
|
.SS Keyboard commands
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-Return
|
.B Mod1\-Shift\-Return
|
||||||
Start
|
Start
|
||||||
.BR xterm (1).
|
.BR xterm.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Tab
|
.B Mod1\-Return
|
||||||
|
Zooms/cycles current window to/from master area (tiled layout only).
|
||||||
|
.TP
|
||||||
|
.B Mod1\-j
|
||||||
Focus next window.
|
Focus next window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-Tab
|
.B Mod1\-k
|
||||||
Focus previous window.
|
Focus previous window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Return
|
.B Mod1\-Shift\-j
|
||||||
Zooms/cycles current window to/from master area (tiling layout), toggles maximization of current window (versatile layout).
|
Increase the number of windows in the master area (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-g
|
.B Mod1\-Shift\-k
|
||||||
Grow master area (tiling layout only).
|
Decrease the number of windows in the master area (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-s
|
.B Mod1\-l
|
||||||
Shrink master area (tiling layout only).
|
Increase master area width (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-i
|
.B Mod1\-h
|
||||||
Increase the number of windows in the master area (tiling layout only).
|
Decrease master area width (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-d
|
.B Mod1\-m
|
||||||
Decrease the number of windows in the master area (tiling layout only).
|
Toggles maximization of current window (floating layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-[1..n]
|
.B Mod1\-Shift\-[1..n]
|
||||||
Apply
|
Apply
|
||||||
.RB nth
|
.RB nth
|
||||||
tag to current window.
|
tag to current window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-0
|
.B Mod1\-Shift\-0
|
||||||
Apply all tags to current window.
|
Apply all tags to current window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Control-Shift-[1..n]
|
.B Mod1\-Control\-Shift\-[1..n]
|
||||||
Add/remove
|
Add/remove
|
||||||
.B nth
|
.B nth
|
||||||
tag to/from current window.
|
tag to/from current window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-c
|
.B Mod1\-Shift\-c
|
||||||
Close focused window.
|
Close focused window.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-space
|
.B Mod1\-space
|
||||||
Toggle between tiling and versatile layout (affects all windows).
|
Toggle between tiled and floating layout (affects all windows).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-space
|
.B Mod1\-Shift\-space
|
||||||
Toggle focused window between versatile and non-versatile state (tiling layout only).
|
Toggle focused window between tiled and floating state (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-[1..n]
|
.B Mod1\-[1..n]
|
||||||
View all windows with
|
View all windows with
|
||||||
.BR nth
|
.BR nth
|
||||||
tag.
|
tag.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-0
|
.B Mod1\-0
|
||||||
View all windows with any tag.
|
View all windows with any tag.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Control-[1..n]
|
.B Mod1\-Control\-[1..n]
|
||||||
Add/remove all windows with
|
Add/remove all windows with
|
||||||
.BR nth
|
.BR nth
|
||||||
tag to/from the view.
|
tag to/from the view.
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Shift-q
|
.B Mod1\-Shift\-q
|
||||||
Quit dwm.
|
Quit dwm.
|
||||||
.SS Mouse commands
|
.SS Mouse commands
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Button1
|
.B Mod1\-Button1
|
||||||
Move current window while dragging (versatile layout only).
|
Move current window while dragging (floating layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Button2
|
.B Mod1\-Button2
|
||||||
Zooms/cycles current window to/from master area (tiling layout), toggles maximization of current window (versatile layout).
|
Zooms/cycles current window to/from master area (tiled layout only).
|
||||||
.TP
|
.TP
|
||||||
.B Mod1-Button3
|
.B Mod1\-Button3
|
||||||
Resize current window while dragging (versatile layout only).
|
Resize current window while dragging (floating layout only).
|
||||||
.SH CUSTOMIZATION
|
.SH CUSTOMIZATION
|
||||||
dwm is customized by creating a custom config.h and (re)compiling the source
|
dwm is customized by creating a custom config.h and (re)compiling the source
|
||||||
code. This keeps it fast, secure and simple.
|
code. This keeps it fast, secure and simple.
|
||||||
|
145
dwm.h
145
dwm.h
@ -41,38 +41,16 @@ enum { WMProtocols, WMDelete, WMState, WMLast }; /* default atoms */
|
|||||||
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
|
||||||
enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
|
enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
|
||||||
|
|
||||||
typedef union {
|
|
||||||
const char *cmd;
|
|
||||||
int i;
|
|
||||||
} Arg; /* argument type */
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int ascent;
|
|
||||||
int descent;
|
|
||||||
int height;
|
|
||||||
XFontSet set;
|
|
||||||
XFontStruct *xfont;
|
|
||||||
} Fnt;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int x, y, w, h;
|
|
||||||
unsigned long norm[ColLast];
|
|
||||||
unsigned long sel[ColLast];
|
|
||||||
Drawable drawable;
|
|
||||||
Fnt font;
|
|
||||||
GC gc;
|
|
||||||
} DC; /* draw context */
|
|
||||||
|
|
||||||
typedef struct Client Client;
|
typedef struct Client Client;
|
||||||
struct Client {
|
struct Client {
|
||||||
char name[256];
|
char name[256];
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
int rx, ry, rw, rh; /* revert geometry */
|
int rx, ry, rw, rh; /* revert geometry */
|
||||||
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
|
||||||
int minax, minay, maxax, maxay;
|
int minax, maxax, minay, maxay;
|
||||||
long flags;
|
long flags;
|
||||||
unsigned int border;
|
unsigned int border;
|
||||||
Bool isbanned, isfixed, ismax, isversatile;
|
Bool isbanned, isfixed, ismax, isfloating;
|
||||||
Bool *tags;
|
Bool *tags;
|
||||||
Client *next;
|
Client *next;
|
||||||
Client *prev;
|
Client *prev;
|
||||||
@ -80,77 +58,90 @@ struct Client {
|
|||||||
Window win;
|
Window win;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int x, y, w, h;
|
||||||
|
unsigned long norm[ColLast];
|
||||||
|
unsigned long sel[ColLast];
|
||||||
|
Drawable drawable;
|
||||||
|
GC gc;
|
||||||
|
struct {
|
||||||
|
int ascent;
|
||||||
|
int descent;
|
||||||
|
int height;
|
||||||
|
XFontSet set;
|
||||||
|
XFontStruct *xfont;
|
||||||
|
} font;
|
||||||
|
} DC; /* draw context */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *symbol;
|
const char *symbol;
|
||||||
void (*arrange)(void);
|
void (*arrange)(void);
|
||||||
} Layout;
|
} Layout;
|
||||||
|
|
||||||
extern const char *tags[]; /* all tags */
|
extern const char *tags[]; /* all tags */
|
||||||
extern char stext[256]; /* status text */
|
char stext[256]; /* status text */
|
||||||
extern int screen, sx, sy, sw, sh; /* screen geometry */
|
int screen, sx, sy, sw, sh; /* screen geometry */
|
||||||
extern int wax, way, wah, waw; /* windowarea geometry */
|
int wax, way, wah, waw; /* windowarea geometry */
|
||||||
extern unsigned int bh, blw; /* bar height, bar layout label width */
|
unsigned int bh, blw; /* bar height, bar layout label width */
|
||||||
extern unsigned int master, nmaster; /* master percent, number of master clients */
|
unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */
|
||||||
extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */
|
void (*handler[LASTEvent])(XEvent *); /* event handler */
|
||||||
extern void (*handler[LASTEvent])(XEvent *); /* event handler */
|
Atom wmatom[WMLast], netatom[NetLast];
|
||||||
extern Atom wmatom[WMLast], netatom[NetLast];
|
Bool selscreen, *seltag; /* seltag is array of Bool */
|
||||||
extern Bool running, selscreen, *seltag; /* seltag is array of Bool */
|
Client *clients, *sel, *stack; /* global client list and stack */
|
||||||
extern Client *clients, *sel, *stack; /* global client list and stack */
|
Cursor cursor[CurLast];
|
||||||
extern Cursor cursor[CurLast];
|
DC dc; /* global draw context */
|
||||||
extern DC dc; /* global draw context */
|
Display *dpy;
|
||||||
extern Display *dpy;
|
Layout *lt;
|
||||||
extern Layout *lt;
|
Window root, barwin;
|
||||||
extern Window root, barwin;
|
|
||||||
|
|
||||||
/* client.c */
|
/* client.c */
|
||||||
extern void configure(Client *c); /* send synthetic configure event */
|
void attach(Client *c); /* attaches c to global client list */
|
||||||
extern void focus(Client *c); /* focus c, c may be NULL */
|
void configure(Client *c); /* send synthetic configure event */
|
||||||
extern void focusnext(Arg *arg); /* focuses next visible client, arg is ignored */
|
void detach(Client *c); /* detaches c from global client list */
|
||||||
extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ignored */
|
void focus(Client *c); /* focus c, c may be NULL */
|
||||||
extern void killclient(Arg *arg); /* kill c nicely */
|
void killclient(const char *arg); /* kill c nicely */
|
||||||
extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
|
void manage(Window w, XWindowAttributes *wa); /* manage new client */
|
||||||
extern Client *nexttiled(Client *c); /* returns tiled successor of c */
|
void resize(Client *c, int x, int y,
|
||||||
extern void resize(Client *c, int x, int y,
|
|
||||||
int w, int h, Bool sizehints); /* resize with given coordinates c*/
|
int w, int h, Bool sizehints); /* resize with given coordinates c*/
|
||||||
extern void updatesizehints(Client *c); /* update the size hint variables of c */
|
void togglefloating(const char *arg); /* toggles focused client between floating/tiled state */
|
||||||
extern void updatetitle(Client *c); /* update the name of c */
|
void updatesizehints(Client *c); /* update the size hint variables of c */
|
||||||
extern void unmanage(Client *c); /* destroy c */
|
void updatetitle(Client *c); /* update the name of c */
|
||||||
extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */
|
void unmanage(Client *c); /* destroy c */
|
||||||
|
|
||||||
/* draw.c */
|
/* draw.c */
|
||||||
extern void drawstatus(void); /* draw the bar */
|
void drawstatus(void); /* draw the bar */
|
||||||
extern void drawtext(const char *text,
|
void drawtext(const char *text, unsigned long col[ColLast]); /* draw text */
|
||||||
unsigned long col[ColLast]); /* draw text */
|
unsigned int textw(const char *text); /* return the width of text in px*/
|
||||||
extern unsigned int textw(const char *text); /* return the width of text in px*/
|
|
||||||
|
|
||||||
/* event.c */
|
/* event.c */
|
||||||
extern void grabkeys(void); /* grab all keys defined in config.h */
|
void grabkeys(void); /* grab all keys defined in config.h */
|
||||||
|
|
||||||
/* layout.c */
|
/* layout.c */
|
||||||
extern void incnmaster(Arg *arg); /* increments nmaster with arg's index value */
|
void floating(void); /* arranges all windows floating */
|
||||||
extern void initlayouts(void); /* initialize layout array */
|
void focusclient(const char *arg); /* focuses next(1)/previous(-1) visible client */
|
||||||
extern void resizemaster(Arg *arg); /* resizes the master percent with arg's index value */
|
void incmasterw(const char *arg); /* increments the master width with arg's index value */
|
||||||
extern void restack(void); /* restores z layers of all clients */
|
void incnmaster(const char *arg); /* increments nmaster with arg's index value */
|
||||||
extern void setlayout(Arg *arg); /* sets layout, -1 toggles */
|
void initlayouts(void); /* initialize layout array */
|
||||||
extern void toggleversatile(Arg *arg); /* toggles focusesd client between versatile/and non-versatile state */
|
Client *nexttiled(Client *c); /* returns tiled successor of c */
|
||||||
extern void versatile(void); /* arranges all windows versatile */
|
void restack(void); /* restores z layers of all clients */
|
||||||
|
void setlayout(const char *arg); /* sets layout, -1 toggles */
|
||||||
|
void togglemax(const char *arg); /* toggles maximization of floating client */
|
||||||
|
void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */
|
||||||
|
|
||||||
/* main.c */
|
/* main.c */
|
||||||
extern void quit(Arg *arg); /* quit dwm nicely */
|
void quit(const char *arg); /* quit dwm nicely */
|
||||||
extern void sendevent(Window w, Atom a, long value); /* send synthetic event to w */
|
int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
|
||||||
extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
|
|
||||||
|
|
||||||
/* tag.c */
|
/* tag.c */
|
||||||
extern void compileregs(void); /* initialize regexps of rules defined in config.h */
|
void compileregs(void); /* initialize regexps of rules defined in config.h */
|
||||||
extern Bool isvisible(Client *c); /* returns True if client is visible */
|
Bool isvisible(Client *c); /* returns True if client is visible */
|
||||||
extern void settags(Client *c, Client *trans); /* sets tags of c */
|
void settags(Client *c, Client *trans); /* sets tags of c */
|
||||||
extern void tag(Arg *arg); /* tags c with arg's index */
|
void tag(const char *arg); /* tags c with arg's index */
|
||||||
extern void toggletag(Arg *arg); /* toggles c tags with arg's index */
|
void toggletag(const char *arg); /* toggles c tags with arg's index */
|
||||||
extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */
|
void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */
|
||||||
extern void view(Arg *arg); /* views the tag with arg's index */
|
void view(const char *arg); /* views the tag with arg's index */
|
||||||
|
|
||||||
/* util.c */
|
/* util.c */
|
||||||
extern void *emallocz(unsigned int size); /* allocates zero-initialized memory, exits on error */
|
void *emallocz(unsigned int size); /* allocates zero-initialized memory, exits on error */
|
||||||
extern void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */
|
void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */
|
||||||
extern void spawn(Arg *arg); /* forks a new subprocess with arg's cmd */
|
void spawn(const char *arg); /* forks a new subprocess with arg's cmd */
|
||||||
|
|
||||||
|
44
event.c
44
event.c
@ -2,6 +2,7 @@
|
|||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
@ -11,8 +12,8 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned long mod;
|
unsigned long mod;
|
||||||
KeySym keysym;
|
KeySym keysym;
|
||||||
void (*func)(Arg *arg);
|
void (*func)(const char *arg);
|
||||||
Arg arg;
|
const char *arg;
|
||||||
} Key;
|
} Key;
|
||||||
|
|
||||||
KEYS
|
KEYS
|
||||||
@ -112,27 +113,29 @@ resizemouse(Client *c) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
buttonpress(XEvent *e) {
|
buttonpress(XEvent *e) {
|
||||||
int x;
|
static char buf[32];
|
||||||
Arg a;
|
unsigned int i, x;
|
||||||
Client *c;
|
Client *c;
|
||||||
XButtonPressedEvent *ev = &e->xbutton;
|
XButtonPressedEvent *ev = &e->xbutton;
|
||||||
|
|
||||||
|
buf[0] = 0;
|
||||||
if(barwin == ev->window) {
|
if(barwin == ev->window) {
|
||||||
x = 0;
|
x = 0;
|
||||||
for(a.i = 0; a.i < ntags; a.i++) {
|
for(i = 0; i < ntags; i++) {
|
||||||
x += textw(tags[a.i]);
|
x += textw(tags[i]);
|
||||||
if(ev->x < x) {
|
if(ev->x < x) {
|
||||||
|
snprintf(buf, sizeof buf, "%d", i);
|
||||||
if(ev->button == Button1) {
|
if(ev->button == Button1) {
|
||||||
if(ev->state & MODKEY)
|
if(ev->state & MODKEY)
|
||||||
tag(&a);
|
tag(buf);
|
||||||
else
|
else
|
||||||
view(&a);
|
view(buf);
|
||||||
}
|
}
|
||||||
else if(ev->button == Button3) {
|
else if(ev->button == Button3) {
|
||||||
if(ev->state & MODKEY)
|
if(ev->state & MODKEY)
|
||||||
toggletag(&a);
|
toggletag(buf);
|
||||||
else
|
else
|
||||||
toggleview(&a);
|
toggleview(buf);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -140,16 +143,7 @@ buttonpress(XEvent *e) {
|
|||||||
if(ev->x < x + blw)
|
if(ev->x < x + blw)
|
||||||
switch(ev->button) {
|
switch(ev->button) {
|
||||||
case Button1:
|
case Button1:
|
||||||
a.i = -1;
|
setlayout(NULL);
|
||||||
setlayout(&a);
|
|
||||||
break;
|
|
||||||
case Button4:
|
|
||||||
a.i = 1;
|
|
||||||
incnmaster(&a);
|
|
||||||
break;
|
|
||||||
case Button5:
|
|
||||||
a.i = -1;
|
|
||||||
incnmaster(&a);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,14 +151,14 @@ buttonpress(XEvent *e) {
|
|||||||
focus(c);
|
focus(c);
|
||||||
if(CLEANMASK(ev->state) != MODKEY)
|
if(CLEANMASK(ev->state) != MODKEY)
|
||||||
return;
|
return;
|
||||||
if(ev->button == Button1 && (lt->arrange == versatile || c->isversatile)) {
|
if(ev->button == Button1 && (lt->arrange == floating || c->isfloating)) {
|
||||||
restack();
|
restack();
|
||||||
movemouse(c);
|
movemouse(c);
|
||||||
}
|
}
|
||||||
else if(ev->button == Button2)
|
else if(ev->button == Button2)
|
||||||
zoom(NULL);
|
zoom(NULL);
|
||||||
else if(ev->button == Button3
|
else if(ev->button == Button3
|
||||||
&& (lt->arrange == versatile || c->isversatile) && !c->isfixed)
|
&& (lt->arrange == floating || c->isfloating) && !c->isfixed)
|
||||||
{
|
{
|
||||||
restack();
|
restack();
|
||||||
resizemouse(c);
|
resizemouse(c);
|
||||||
@ -182,7 +176,7 @@ configurerequest(XEvent *e) {
|
|||||||
c->ismax = False;
|
c->ismax = False;
|
||||||
if(ev->value_mask & CWBorderWidth)
|
if(ev->value_mask & CWBorderWidth)
|
||||||
c->border = ev->border_width;
|
c->border = ev->border_width;
|
||||||
if(c->isfixed || c->isversatile || (lt->arrange == versatile)) {
|
if(c->isfixed || c->isfloating || (lt->arrange == floating)) {
|
||||||
if(ev->value_mask & CWX)
|
if(ev->value_mask & CWX)
|
||||||
c->x = ev->x;
|
c->x = ev->x;
|
||||||
if(ev->value_mask & CWY)
|
if(ev->value_mask & CWY)
|
||||||
@ -261,7 +255,7 @@ keypress(XEvent *e) {
|
|||||||
&& CLEANMASK(key[i].mod) == CLEANMASK(ev->state))
|
&& CLEANMASK(key[i].mod) == CLEANMASK(ev->state))
|
||||||
{
|
{
|
||||||
if(key[i].func)
|
if(key[i].func)
|
||||||
key[i].func(&key[i].arg);
|
key[i].func(key[i].arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,7 +304,7 @@ propertynotify(XEvent *e) {
|
|||||||
default: break;
|
default: break;
|
||||||
case XA_WM_TRANSIENT_FOR:
|
case XA_WM_TRANSIENT_FOR:
|
||||||
XGetTransientForHint(dpy, c->win, &trans);
|
XGetTransientForHint(dpy, c->win, &trans);
|
||||||
if(!c->isversatile && (c->isversatile = (getclient(trans) != NULL)))
|
if(!c->isfloating && (c->isfloating = (getclient(trans) != NULL)))
|
||||||
lt->arrange();
|
lt->arrange();
|
||||||
break;
|
break;
|
||||||
case XA_WM_NORMAL_HINTS:
|
case XA_WM_NORMAL_HINTS:
|
||||||
|
266
layout.c
266
layout.c
@ -2,15 +2,16 @@
|
|||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
unsigned int master = MASTER;
|
|
||||||
unsigned int nmaster = NMASTER;
|
|
||||||
unsigned int blw = 0;
|
unsigned int blw = 0;
|
||||||
Layout *lt = NULL;
|
Layout *lt = NULL;
|
||||||
|
|
||||||
/* static */
|
/* static */
|
||||||
|
|
||||||
static unsigned int nlayouts = 0;
|
static unsigned int nlayouts = 0;
|
||||||
|
static unsigned int masterw = MASTERWIDTH;
|
||||||
|
static unsigned int nmaster = NMASTER;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tile(void) {
|
tile(void) {
|
||||||
@ -21,7 +22,7 @@ tile(void) {
|
|||||||
n++;
|
n++;
|
||||||
/* window geoms */
|
/* window geoms */
|
||||||
mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
|
mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
|
||||||
mw = (n > nmaster) ? (waw * master) / 1000 : waw;
|
mw = (n > nmaster) ? (waw * masterw) / 1000 : waw;
|
||||||
th = (n > nmaster) ? wah / (n - nmaster) : 0;
|
th = (n > nmaster) ? wah / (n - nmaster) : 0;
|
||||||
tw = waw - mw;
|
tw = waw - mw;
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ tile(void) {
|
|||||||
if(c->isbanned)
|
if(c->isbanned)
|
||||||
XMoveWindow(dpy, c->win, c->x, c->y);
|
XMoveWindow(dpy, c->win, c->x, c->y);
|
||||||
c->isbanned = False;
|
c->isbanned = False;
|
||||||
if(c->isversatile)
|
if(c->isfloating)
|
||||||
continue;
|
continue;
|
||||||
c->ismax = False;
|
c->ismax = False;
|
||||||
nx = wax;
|
nx = wax;
|
||||||
@ -69,100 +70,7 @@ LAYOUTS
|
|||||||
/* extern */
|
/* extern */
|
||||||
|
|
||||||
void
|
void
|
||||||
incnmaster(Arg *arg) {
|
floating(void) {
|
||||||
if((lt->arrange != tile) || (nmaster + arg->i < 1)
|
|
||||||
|| (wah / (nmaster + arg->i) <= 2 * BORDERPX))
|
|
||||||
return;
|
|
||||||
nmaster += arg->i;
|
|
||||||
if(sel)
|
|
||||||
lt->arrange();
|
|
||||||
else
|
|
||||||
drawstatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
initlayouts(void) {
|
|
||||||
unsigned int i, w;
|
|
||||||
|
|
||||||
lt = &layout[0];
|
|
||||||
nlayouts = sizeof layout / sizeof layout[0];
|
|
||||||
for(blw = i = 0; i < nlayouts; i++) {
|
|
||||||
w = textw(layout[i].symbol);
|
|
||||||
if(w > blw)
|
|
||||||
blw = w;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
resizemaster(Arg *arg) {
|
|
||||||
if(lt->arrange != tile)
|
|
||||||
return;
|
|
||||||
if(arg->i == 0)
|
|
||||||
master = MASTER;
|
|
||||||
else {
|
|
||||||
if(waw * (master + arg->i) / 1000 >= waw - 2 * BORDERPX
|
|
||||||
|| waw * (master + arg->i) / 1000 <= 2 * BORDERPX)
|
|
||||||
return;
|
|
||||||
master += arg->i;
|
|
||||||
}
|
|
||||||
lt->arrange();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
restack(void) {
|
|
||||||
Client *c;
|
|
||||||
XEvent ev;
|
|
||||||
|
|
||||||
drawstatus();
|
|
||||||
if(!sel)
|
|
||||||
return;
|
|
||||||
if(sel->isversatile || lt->arrange == versatile)
|
|
||||||
XRaiseWindow(dpy, sel->win);
|
|
||||||
if(lt->arrange != versatile) {
|
|
||||||
if(!sel->isversatile)
|
|
||||||
XLowerWindow(dpy, sel->win);
|
|
||||||
for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
|
|
||||||
if(c == sel)
|
|
||||||
continue;
|
|
||||||
XLowerWindow(dpy, c->win);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
XSync(dpy, False);
|
|
||||||
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
setlayout(Arg *arg) {
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
if(arg->i == -1) {
|
|
||||||
for(i = 0; i < nlayouts && lt != &layout[i]; i++);
|
|
||||||
if(i == nlayouts - 1)
|
|
||||||
lt = &layout[0];
|
|
||||||
else
|
|
||||||
lt = &layout[++i];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(arg->i < 0 || arg->i >= nlayouts)
|
|
||||||
return;
|
|
||||||
lt = &layout[arg->i];
|
|
||||||
}
|
|
||||||
if(sel)
|
|
||||||
lt->arrange();
|
|
||||||
else
|
|
||||||
drawstatus();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
toggleversatile(Arg *arg) {
|
|
||||||
if(!sel || lt->arrange == versatile)
|
|
||||||
return;
|
|
||||||
sel->isversatile = !sel->isversatile;
|
|
||||||
lt->arrange();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
versatile(void) {
|
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
for(c = clients; c; c = c->next) {
|
for(c = clients; c; c = c->next) {
|
||||||
@ -183,3 +91,165 @@ versatile(void) {
|
|||||||
}
|
}
|
||||||
restack();
|
restack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
focusclient(const char *arg) {
|
||||||
|
Client *c;
|
||||||
|
|
||||||
|
if(!sel || !arg)
|
||||||
|
return;
|
||||||
|
if(atoi(arg) < 0) {
|
||||||
|
for(c = sel->prev; c && !isvisible(c); c = c->prev);
|
||||||
|
if(!c) {
|
||||||
|
for(c = clients; c && c->next; c = c->next);
|
||||||
|
for(; c && !isvisible(c); c = c->prev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for(c = sel->next; c && !isvisible(c); c = c->next);
|
||||||
|
if(!c)
|
||||||
|
for(c = clients; c && !isvisible(c); c = c->next);
|
||||||
|
}
|
||||||
|
if(c) {
|
||||||
|
focus(c);
|
||||||
|
restack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
incmasterw(const char *arg) {
|
||||||
|
int i;
|
||||||
|
if(lt->arrange != tile)
|
||||||
|
return;
|
||||||
|
if(!arg)
|
||||||
|
masterw = MASTERWIDTH;
|
||||||
|
else {
|
||||||
|
i = atoi(arg);
|
||||||
|
if(waw * (masterw + i) / 1000 >= waw - 2 * BORDERPX
|
||||||
|
|| waw * (masterw + i) / 1000 <= 2 * BORDERPX)
|
||||||
|
return;
|
||||||
|
masterw += i;
|
||||||
|
}
|
||||||
|
lt->arrange();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
incnmaster(const char *arg) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(!arg)
|
||||||
|
nmaster = NMASTER;
|
||||||
|
else {
|
||||||
|
i = atoi(arg);
|
||||||
|
if((lt->arrange != tile) || (nmaster + i < 1)
|
||||||
|
|| (wah / (nmaster + i) <= 2 * BORDERPX))
|
||||||
|
return;
|
||||||
|
nmaster += i;
|
||||||
|
}
|
||||||
|
if(sel)
|
||||||
|
lt->arrange();
|
||||||
|
else
|
||||||
|
drawstatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
initlayouts(void) {
|
||||||
|
unsigned int i, w;
|
||||||
|
|
||||||
|
lt = &layout[0];
|
||||||
|
nlayouts = sizeof layout / sizeof layout[0];
|
||||||
|
for(blw = i = 0; i < nlayouts; i++) {
|
||||||
|
w = textw(layout[i].symbol);
|
||||||
|
if(w > blw)
|
||||||
|
blw = w;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Client *
|
||||||
|
nexttiled(Client *c) {
|
||||||
|
for(; c && (c->isfloating || !isvisible(c)); c = c->next);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
restack(void) {
|
||||||
|
Client *c;
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
drawstatus();
|
||||||
|
if(!sel)
|
||||||
|
return;
|
||||||
|
if(sel->isfloating || lt->arrange == floating)
|
||||||
|
XRaiseWindow(dpy, sel->win);
|
||||||
|
if(lt->arrange != floating) {
|
||||||
|
if(!sel->isfloating)
|
||||||
|
XLowerWindow(dpy, sel->win);
|
||||||
|
for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
|
||||||
|
if(c == sel)
|
||||||
|
continue;
|
||||||
|
XLowerWindow(dpy, c->win);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
XSync(dpy, False);
|
||||||
|
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
setlayout(const char *arg) {
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(!arg) {
|
||||||
|
for(i = 0; i < nlayouts && lt != &layout[i]; i++);
|
||||||
|
if(i == nlayouts - 1)
|
||||||
|
lt = &layout[0];
|
||||||
|
else
|
||||||
|
lt = &layout[++i];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
i = atoi(arg);
|
||||||
|
if(i < 0 || i >= nlayouts)
|
||||||
|
return;
|
||||||
|
lt = &layout[i];
|
||||||
|
}
|
||||||
|
if(sel)
|
||||||
|
lt->arrange();
|
||||||
|
else
|
||||||
|
drawstatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
togglemax(const char *arg) {
|
||||||
|
XEvent ev;
|
||||||
|
|
||||||
|
if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed)
|
||||||
|
return;
|
||||||
|
if((sel->ismax = !sel->ismax)) {
|
||||||
|
sel->rx = sel->x;
|
||||||
|
sel->ry = sel->y;
|
||||||
|
sel->rw = sel->w;
|
||||||
|
sel->rh = sel->h;
|
||||||
|
resize(sel, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX, True);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
|
||||||
|
drawstatus();
|
||||||
|
while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
zoom(const char *arg) {
|
||||||
|
unsigned int n;
|
||||||
|
Client *c;
|
||||||
|
|
||||||
|
if(!sel || lt->arrange != tile || sel->isfloating)
|
||||||
|
return;
|
||||||
|
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
|
||||||
|
n++;
|
||||||
|
if((c = sel) == nexttiled(clients))
|
||||||
|
if(!(c = nexttiled(c->next)))
|
||||||
|
return;
|
||||||
|
detach(c);
|
||||||
|
attach(c);
|
||||||
|
focus(c);
|
||||||
|
lt->arrange();
|
||||||
|
}
|
||||||
|
21
main.c
21
main.c
@ -21,7 +21,6 @@ char stext[256];
|
|||||||
int screen, sx, sy, sw, sh, wax, way, waw, wah;
|
int screen, sx, sy, sw, sh, wax, way, waw, wah;
|
||||||
unsigned int bh, ntags, numlockmask;
|
unsigned int bh, ntags, numlockmask;
|
||||||
Atom wmatom[WMLast], netatom[NetLast];
|
Atom wmatom[WMLast], netatom[NetLast];
|
||||||
Bool running = True;
|
|
||||||
Bool *seltag;
|
Bool *seltag;
|
||||||
Bool selscreen = True;
|
Bool selscreen = True;
|
||||||
Client *clients = NULL;
|
Client *clients = NULL;
|
||||||
@ -36,6 +35,7 @@ Window root, barwin;
|
|||||||
|
|
||||||
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
static int (*xerrorxlib)(Display *, XErrorEvent *);
|
||||||
static Bool otherwm, readin;
|
static Bool otherwm, readin;
|
||||||
|
static Bool running = True;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cleanup(void) {
|
cleanup(void) {
|
||||||
@ -205,6 +205,8 @@ setup(void) {
|
|||||||
dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
|
dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
|
||||||
dc.gc = XCreateGC(dpy, root, 0, 0);
|
dc.gc = XCreateGC(dpy, root, 0, 0);
|
||||||
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
|
XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
|
||||||
|
if(!dc.font.set)
|
||||||
|
XSetFont(dpy, dc.gc, dc.font.xfont->fid);
|
||||||
/* multihead support */
|
/* multihead support */
|
||||||
selscreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
|
selscreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
|
||||||
}
|
}
|
||||||
@ -222,21 +224,7 @@ xerrorstart(Display *dsply, XErrorEvent *ee) {
|
|||||||
/* extern */
|
/* extern */
|
||||||
|
|
||||||
void
|
void
|
||||||
sendevent(Window w, Atom a, long value) {
|
quit(const char *arg) {
|
||||||
XEvent e;
|
|
||||||
|
|
||||||
e.type = ClientMessage;
|
|
||||||
e.xclient.window = w;
|
|
||||||
e.xclient.message_type = a;
|
|
||||||
e.xclient.format = 32;
|
|
||||||
e.xclient.data.l[0] = value;
|
|
||||||
e.xclient.data.l[1] = CurrentTime;
|
|
||||||
XSendEvent(dpy, w, False, NoEventMask, &e);
|
|
||||||
XSync(dpy, False);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
quit(Arg *arg) {
|
|
||||||
readin = running = False;
|
readin = running = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +313,6 @@ main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
drawstatus();
|
drawstatus();
|
||||||
}
|
}
|
||||||
if(FD_ISSET(xfd, &rd))
|
|
||||||
while(XPending(dpy)) {
|
while(XPending(dpy)) {
|
||||||
XNextEvent(dpy, &ev);
|
XNextEvent(dpy, &ev);
|
||||||
if(handler[ev.type])
|
if(handler[ev.type])
|
||||||
|
52
tag.c
52
tag.c
@ -12,7 +12,7 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
const char *prop;
|
const char *prop;
|
||||||
const char *tags;
|
const char *tags;
|
||||||
Bool isversatile;
|
Bool isfloating;
|
||||||
} Rule;
|
} Rule;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -83,7 +83,7 @@ settags(Client *c, Client *trans) {
|
|||||||
ch.res_name ? ch.res_name : "", c->name);
|
ch.res_name ? ch.res_name : "", c->name);
|
||||||
for(i = 0; i < nrules; i++)
|
for(i = 0; i < nrules; i++)
|
||||||
if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
|
if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
|
||||||
c->isversatile = rule[i].isversatile;
|
c->isfloating = rule[i].isfloating;
|
||||||
for(j = 0; regs[i].tagregex && j < ntags; j++) {
|
for(j = 0; regs[i].tagregex && j < ntags; j++) {
|
||||||
if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
|
if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
|
||||||
matched = True;
|
matched = True;
|
||||||
@ -102,49 +102,53 @@ settags(Client *c, Client *trans) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tag(Arg *arg) {
|
tag(const char *arg) {
|
||||||
unsigned int i;
|
int i;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
for(i = 0; i < ntags; i++)
|
for(i = 0; i < ntags; i++)
|
||||||
sel->tags[i] = (arg->i == -1) ? True : False;
|
sel->tags[i] = arg == NULL;
|
||||||
if(arg->i >= 0 && arg->i < ntags)
|
i = arg ? atoi(arg) : 0;
|
||||||
sel->tags[arg->i] = True;
|
if(i >= 0 && i < ntags)
|
||||||
|
sel->tags[i] = True;
|
||||||
lt->arrange();
|
lt->arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
toggletag(Arg *arg) {
|
toggletag(const char *arg) {
|
||||||
unsigned int i;
|
int i, j;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
sel->tags[arg->i] = !sel->tags[arg->i];
|
i = arg ? atoi(arg) : 0;
|
||||||
for(i = 0; i < ntags && !sel->tags[i]; i++);
|
sel->tags[i] = !sel->tags[i];
|
||||||
if(i == ntags)
|
for(j = 0; j < ntags && !sel->tags[j]; j++);
|
||||||
sel->tags[arg->i] = True;
|
if(j == ntags)
|
||||||
|
sel->tags[i] = True;
|
||||||
lt->arrange();
|
lt->arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
toggleview(Arg *arg) {
|
toggleview(const char *arg) {
|
||||||
unsigned int i;
|
int i, j;
|
||||||
|
|
||||||
seltag[arg->i] = !seltag[arg->i];
|
i = arg ? atoi(arg) : 0;
|
||||||
for(i = 0; i < ntags && !seltag[i]; i++);
|
seltag[i] = !seltag[i];
|
||||||
if(i == ntags)
|
for(j = 0; j < ntags && !seltag[j]; j++);
|
||||||
seltag[arg->i] = True; /* cannot toggle last view */
|
if(j == ntags)
|
||||||
|
seltag[i] = True; /* cannot toggle last view */
|
||||||
lt->arrange();
|
lt->arrange();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
view(Arg *arg) {
|
view(const char *arg) {
|
||||||
unsigned int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; i < ntags; i++)
|
for(i = 0; i < ntags; i++)
|
||||||
seltag[i] = (arg->i == -1) ? True : False;
|
seltag[i] = arg == NULL;
|
||||||
if(arg->i >= 0 && arg->i < ntags)
|
i = arg ? atoi(arg) : 0;
|
||||||
seltag[arg->i] = True;
|
if(i >= 0 && i < ntags)
|
||||||
|
seltag[i] = True;
|
||||||
lt->arrange();
|
lt->arrange();
|
||||||
}
|
}
|
||||||
|
8
util.c
8
util.c
@ -30,12 +30,12 @@ eprint(const char *errstr, ...) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
spawn(Arg *arg) {
|
spawn(const char *arg) {
|
||||||
static char *shell = NULL;
|
static char *shell = NULL;
|
||||||
|
|
||||||
if(!shell && !(shell = getenv("SHELL")))
|
if(!shell && !(shell = getenv("SHELL")))
|
||||||
shell = "/bin/sh";
|
shell = "/bin/sh";
|
||||||
if(!arg->cmd)
|
if(!arg)
|
||||||
return;
|
return;
|
||||||
/* The double-fork construct avoids zombie processes and keeps the code
|
/* The double-fork construct avoids zombie processes and keeps the code
|
||||||
* clean from stupid signal handlers. */
|
* clean from stupid signal handlers. */
|
||||||
@ -44,8 +44,8 @@ spawn(Arg *arg) {
|
|||||||
if(dpy)
|
if(dpy)
|
||||||
close(ConnectionNumber(dpy));
|
close(ConnectionNumber(dpy));
|
||||||
setsid();
|
setsid();
|
||||||
execl(shell, shell, "-c", arg->cmd, (char *)NULL);
|
execl(shell, shell, "-c", arg, (char *)NULL);
|
||||||
fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg->cmd);
|
fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg);
|
||||||
perror(" failed");
|
perror(" failed");
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
|
Reference in New Issue
Block a user