Compare commits
38 Commits
Author | SHA1 | Date | |
---|---|---|---|
c95fe6e24b | |||
c75168186b | |||
3a96c9a8d5 | |||
1617b95598 | |||
726ae5bf6d | |||
3e11b38349 | |||
16ed879524 | |||
20d7b5d058 | |||
11a08b9cfc | |||
c2b753d917 | |||
6c767072a3 | |||
e9cfae7aba | |||
7ac0de8350 | |||
0b7c0f10ee | |||
51f6405b0d | |||
6096f8a113 | |||
d939f301fa | |||
8c4623da80 | |||
0faaba04a5 | |||
ec7a5ffff1 | |||
98afb7b9d0 | |||
06bae9dfb7 | |||
0b80d1842d | |||
d7ec23a5db | |||
2cf8ef9520 | |||
184471b4bb | |||
21898c6049 | |||
6a9300e815 | |||
ac24f132db | |||
cb4aa5bc35 | |||
beac539f31 | |||
b5d297f02f | |||
9056d7ea88 | |||
ebd17e4827 | |||
7e59c89250 | |||
9e4e4d9022 | |||
71fd06f843 | |||
58e6866d86 |
2
.hgtags
2
.hgtags
@ -26,3 +26,5 @@ a2c465098a3b972bbed00feda9804b6aae1e9531 2.1
|
|||||||
dcbbfabc8ecc5f33a6cc950584de87da1a368045 2.5
|
dcbbfabc8ecc5f33a6cc950584de87da1a368045 2.5
|
||||||
c7f84f23ec5aef29988dcdc4ec22a7352ee8f58e 2.5.1
|
c7f84f23ec5aef29988dcdc4ec22a7352ee8f58e 2.5.1
|
||||||
5308dd22b6ee8e3218c81d9e7e4125f235bb5778 2.6
|
5308dd22b6ee8e3218c81d9e7e4125f235bb5778 2.6
|
||||||
|
21951c0dfbae5af68ed77821a4d87253ee91803f 2.7
|
||||||
|
107719a9ce3bd0c79f9f1f626596eb338a276561 2.8
|
||||||
|
4
LICENSE
4
LICENSE
@ -1,7 +1,7 @@
|
|||||||
MIT/X Consortium License
|
MIT/X Consortium License
|
||||||
|
|
||||||
(C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
(C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
(C)opyright MMVI Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
(C)opyright MMVI-MMVII Sander van Dijk <a dot h dot vandijk at gmail dot com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
copy of this software and associated documentation files (the "Software"),
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
# dwm - dynamic window manager
|
# dwm - dynamic window manager
|
||||||
# (C)opyright MMVI Anselm R. Garbe
|
# (C)opyright MMVII Anselm R. Garbe
|
||||||
|
|
||||||
include config.mk
|
include config.mk
|
||||||
|
|
||||||
|
10
client.c
10
client.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
@ -96,7 +96,7 @@ focus(Client *c) {
|
|||||||
sel = c;
|
sel = c;
|
||||||
if(old) {
|
if(old) {
|
||||||
grabbuttons(old, False);
|
grabbuttons(old, False);
|
||||||
drawtitle(old);
|
drawclient(old);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(c) {
|
if(c) {
|
||||||
@ -104,7 +104,7 @@ focus(Client *c) {
|
|||||||
c->snext = stack;
|
c->snext = stack;
|
||||||
stack = c;
|
stack = c;
|
||||||
grabbuttons(c, True);
|
grabbuttons(c, True);
|
||||||
drawtitle(c);
|
drawclient(c);
|
||||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -156,7 +156,7 @@ manage(Window w, XWindowAttributes *wa) {
|
|||||||
c->w = c->tw = wa->width;
|
c->w = c->tw = wa->width;
|
||||||
c->h = wa->height;
|
c->h = wa->height;
|
||||||
c->th = bh;
|
c->th = bh;
|
||||||
updatesize(c);
|
updatesizehints(c);
|
||||||
if(c->x + c->w + 2 * BORDERPX > sw)
|
if(c->x + c->w + 2 * BORDERPX > sw)
|
||||||
c->x = sw - c->w - 2 * BORDERPX;
|
c->x = sw - c->w - 2 * BORDERPX;
|
||||||
if(c->x < sx)
|
if(c->x < sx)
|
||||||
@ -256,7 +256,7 @@ resizetitle(Client *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
updatesize(Client *c) {
|
updatesizehints(Client *c) {
|
||||||
long msize;
|
long msize;
|
||||||
XSizeHints size;
|
XSizeHints size;
|
||||||
|
|
||||||
|
23
config.arg.h
23
config.arg.h
@ -1,24 +1,25 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TAGS \
|
#define TAGS \
|
||||||
const char *tags[] = { "dev", "work", "net", "fnord", NULL };
|
const char *tags[] = { "home", "net", "www", "mon", "fnord", NULL };
|
||||||
|
|
||||||
#define DEFMODE dotile /* dofloat */
|
#define DEFMODE dotile /* dofloat */
|
||||||
#define FLOATSYMBOL "><>"
|
#define FLOATSYMBOL "><>"
|
||||||
#define TILESYMBOL "[]="
|
#define TILESYMBOL "[]="
|
||||||
|
|
||||||
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
|
#define FONT "-*-terminus-medium-r-*-*-14-*-*-*-*-*-*-*"
|
||||||
#define NORMBGCOLOR "#333333"
|
#define NORMBGCOLOR "#111111"
|
||||||
#define NORMFGCOLOR "#cccccc"
|
#define NORMFGCOLOR "#cccccc"
|
||||||
#define SELBGCOLOR "#336699"
|
#define SELBGCOLOR "#336699"
|
||||||
#define SELFGCOLOR "#dddddd"
|
#define SELFGCOLOR "#eeeeee"
|
||||||
#define STATUSBGCOLOR "#222222"
|
#define STATUSBGCOLOR "#222222"
|
||||||
#define STATUSFGCOLOR "#99ccff"
|
#define STATUSFGCOLOR "#dddddd"
|
||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
#define MASTER 600 /* per thousand */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod1Mask
|
||||||
|
#define NMASTER 1 /* clients in master area */
|
||||||
#define SNAP 40 /* pixel */
|
#define SNAP 40 /* pixel */
|
||||||
|
|
||||||
#define KEYS \
|
#define KEYS \
|
||||||
@ -28,22 +29,26 @@ static Key key[] = { \
|
|||||||
{ .cmd = "exec uxterm -bg black -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
|
{ .cmd = "exec uxterm -bg black -fg '#eeeeee' -cr '#eeeeee' +sb -fn '"FONT"'" } }, \
|
||||||
{ MODKEY, XK_p, spawn, \
|
{ MODKEY, XK_p, spawn, \
|
||||||
{ .cmd = "exe=\"$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u " \
|
{ .cmd = "exe=\"$(lsx `echo $PATH | sed 's/:/ /g'` | sort -u " \
|
||||||
" | dmenu -font '"FONT"' -normbg '"NORMBGCOLOR"' -normfg '"NORMFGCOLOR"' " \
|
" | dmenu -fn '"FONT"' -nb '"NORMBGCOLOR"' -nf '"NORMFGCOLOR"' " \
|
||||||
"-selbg '"SELBGCOLOR"' -selfg '"SELFGCOLOR"')\" && exec $exe" } }, \
|
"-sb '"SELBGCOLOR"' -sf '"SELFGCOLOR"')\" && exec $exe" } }, \
|
||||||
{ MODKEY, XK_j, focusnext, { 0 } }, \
|
{ MODKEY, XK_j, focusnext, { 0 } }, \
|
||||||
{ MODKEY, XK_k, focusprev, { 0 } }, \
|
{ MODKEY, XK_k, focusprev, { 0 } }, \
|
||||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
||||||
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
||||||
{ MODKEY, XK_s, 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_0, tag, { .i = -1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
||||||
|
{ MODKEY|ShiftMask, XK_5, tag, { .i = 4 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
||||||
|
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \
|
||||||
@ -52,17 +57,19 @@ static Key key[] = { \
|
|||||||
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
{ MODKEY, XK_2, view, { .i = 1 } }, \
|
||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||||
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
||||||
|
{ MODKEY, XK_5, view, { .i = 4 } }, \
|
||||||
{ MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
|
{ MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
|
||||||
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
||||||
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
||||||
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
||||||
|
{ MODKEY|ControlMask, XK_5, toggleview, { .i = 4 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
||||||
};
|
};
|
||||||
|
|
||||||
#define RULES \
|
#define RULES \
|
||||||
static Rule rule[] = { \
|
static Rule rule[] = { \
|
||||||
/* class:instance:title regex tags regex isfloat */ \
|
/* class:instance:title regex tags regex isfloat */ \
|
||||||
{ "Firefox.*", "net", False }, \
|
{ "Firefox.*", "www", False }, \
|
||||||
{ "Gimp.*", NULL, True }, \
|
{ "Gimp.*", NULL, True }, \
|
||||||
{ "MPlayer.*", NULL, True }, \
|
{ "MPlayer.*", NULL, True }, \
|
||||||
{ "Acroread.*", NULL, True }, \
|
{ "Acroread.*", NULL, True }, \
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TAGS \
|
#define TAGS \
|
||||||
const char *tags[] = { "1", "2", "3", "4", "5", NULL };
|
const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
|
||||||
|
|
||||||
#define DEFMODE dotile /* dofloat */
|
#define DEFMODE dotile /* dofloat */
|
||||||
#define FLOATSYMBOL "><>"
|
#define FLOATSYMBOL "><>"
|
||||||
@ -19,6 +19,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", NULL };
|
|||||||
|
|
||||||
#define MASTER 600 /* per thousand */
|
#define MASTER 600 /* per thousand */
|
||||||
#define MODKEY Mod1Mask
|
#define MODKEY Mod1Mask
|
||||||
|
#define NMASTER 1 /* clients in master area */
|
||||||
#define SNAP 20 /* pixel */
|
#define SNAP 20 /* pixel */
|
||||||
|
|
||||||
#define KEYS \
|
#define KEYS \
|
||||||
@ -30,17 +31,27 @@ static Key key[] = { \
|
|||||||
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
{ MODKEY, XK_Return, zoom, { 0 } }, \
|
||||||
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
{ MODKEY, XK_g, resizemaster, { .i = 15 } }, \
|
||||||
{ MODKEY, XK_s, 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_0, tag, { .i = -1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
{ MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
{ MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
{ MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
{ MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_5, tag, { .i = 4 } }, \
|
{ 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_1, toggletag, { .i = 0 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
{ MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
|
{ 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|ShiftMask, XK_c, killclient, { 0 } }, \
|
||||||
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
{ MODKEY, XK_space, togglemode, { 0 } }, \
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \
|
{ MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \
|
||||||
@ -50,11 +61,19 @@ static Key key[] = { \
|
|||||||
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
{ MODKEY, XK_3, view, { .i = 2 } }, \
|
||||||
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
{ MODKEY, XK_4, view, { .i = 3 } }, \
|
||||||
{ MODKEY, XK_5, view, { .i = 4 } }, \
|
{ 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_1, toggleview, { .i = 0 } }, \
|
||||||
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
{ MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
|
||||||
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
{ MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
|
||||||
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
{ MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
|
||||||
{ MODKEY|ControlMask, XK_5, toggleview, { .i = 4 } }, \
|
{ 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 } }, \
|
{ MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# dwm version
|
# dwm version
|
||||||
VERSION = 2.7
|
VERSION = 2.9
|
||||||
|
|
||||||
# Customize below to fit your system
|
# Customize below to fit your system
|
||||||
|
|
||||||
@ -20,6 +20,11 @@ LDFLAGS = ${LIBS}
|
|||||||
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
|
#CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\"
|
||||||
#LDFLAGS = -g ${LIBS}
|
#LDFLAGS = -g ${LIBS}
|
||||||
|
|
||||||
|
# Solaris
|
||||||
|
#CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\"
|
||||||
|
#LDFLAGS = ${LIBS}
|
||||||
|
#CFLAGS += -xtarget=ultra
|
||||||
|
|
||||||
# compiler and linker
|
# compiler and linker
|
||||||
CC = cc
|
CC = cc
|
||||||
LD = ${CC}
|
LD = ${CC}
|
||||||
|
6
draw.c
6
draw.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMIV-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
@ -102,7 +102,7 @@ drawall(void) {
|
|||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
for(c = clients; c; c = getnext(c->next))
|
for(c = clients; c; c = getnext(c->next))
|
||||||
drawtitle(c);
|
drawclient(c);
|
||||||
drawstatus();
|
drawstatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ drawstatus(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
drawtitle(Client *c) {
|
drawclient(Client *c) {
|
||||||
if(c == sel && issel) {
|
if(c == sel && issel) {
|
||||||
drawstatus();
|
drawstatus();
|
||||||
XUnmapWindow(dpy, c->twin);
|
XUnmapWindow(dpy, c->twin);
|
||||||
|
10
dwm.1
10
dwm.1
@ -10,10 +10,10 @@ floating modes. Either mode 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 mode windows are managed in a master and stacking area. The master
|
In tiling mode windows are managed in a master and stacking area. The master
|
||||||
area contains the window which currently needs most attention, whereas the
|
area contains the windows which currently need most attention, whereas the
|
||||||
stacking area contains all other windows. In floating mode windows can be
|
stacking area contains all other windows. In floating mode windows can be
|
||||||
resized and moved freely. Dialog windows are always managed floating,
|
resized and moved freely. Dialog windows are always managed floating,
|
||||||
regardless of the mode selected.
|
regardless of the mode 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.
|
||||||
@ -70,6 +70,12 @@ Grow master area (tiling mode only).
|
|||||||
.B Mod1-s
|
.B Mod1-s
|
||||||
Shrink master area (tiling mode only).
|
Shrink master area (tiling mode only).
|
||||||
.TP
|
.TP
|
||||||
|
.B Mod1-i
|
||||||
|
Increase the number of windows in the master area (tiling mode only).
|
||||||
|
.TP
|
||||||
|
.B Mod1-d
|
||||||
|
Decrease the number of windows in the master area (tiling mode only).
|
||||||
|
.TP
|
||||||
.B Mod1-Shift-[1..n]
|
.B Mod1-Shift-[1..n]
|
||||||
Apply
|
Apply
|
||||||
.RB nth
|
.RB nth
|
||||||
|
10
dwm.h
10
dwm.h
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*
|
*
|
||||||
* dynamic window manager is designed like any other X client as well. It is
|
* dynamic window manager is designed like any other X client as well. It is
|
||||||
@ -96,7 +96,8 @@ extern char stext[1024]; /* status text */
|
|||||||
extern int bx, by, bw, bh, bmw; /* bar geometry, bar mode label width */
|
extern int bx, by, bw, bh, bmw; /* bar geometry, bar mode label width */
|
||||||
extern int screen, sx, sy, sw, sh; /* screen geometry */
|
extern int screen, sx, sy, sw, sh; /* screen geometry */
|
||||||
extern int wax, way, wah, waw; /* windowarea geometry */
|
extern int wax, way, wah, waw; /* windowarea geometry */
|
||||||
extern unsigned int master, ntags, numlockmask; /* master percent, number of tags, dynamic lock mask */
|
extern unsigned int master, nmaster; /* master percent, number of master clients */
|
||||||
|
extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */
|
||||||
extern void (*handler[LASTEvent])(XEvent *); /* event handler */
|
extern void (*handler[LASTEvent])(XEvent *); /* event handler */
|
||||||
extern void (*arrange)(void); /* arrange function, indicates mode */
|
extern void (*arrange)(void); /* arrange function, indicates mode */
|
||||||
extern Atom wmatom[WMLast], netatom[NetLast];
|
extern Atom wmatom[WMLast], netatom[NetLast];
|
||||||
@ -117,14 +118,14 @@ extern void killclient(Arg *arg); /* kill c nicely */
|
|||||||
extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
|
extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
|
||||||
extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/
|
extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/
|
||||||
extern void resizetitle(Client *c); /* resizes c->twin correctly */
|
extern void resizetitle(Client *c); /* resizes c->twin correctly */
|
||||||
extern void updatesize(Client *c); /* update the size structs of c */
|
extern void updatesizehints(Client *c); /* update the size hint variables of c */
|
||||||
extern void updatetitle(Client *c); /* update the name of c */
|
extern void updatetitle(Client *c); /* update the name of c */
|
||||||
extern void unmanage(Client *c); /* destroy c */
|
extern void unmanage(Client *c); /* destroy c */
|
||||||
|
|
||||||
/* draw.c */
|
/* draw.c */
|
||||||
extern void drawall(void); /* draw all visible client titles and the bar */
|
extern void drawall(void); /* draw all visible client titles and the bar */
|
||||||
extern void drawstatus(void); /* draw the bar */
|
extern void drawstatus(void); /* draw the bar */
|
||||||
extern void drawtitle(Client *c); /* draw title of c */
|
extern void drawclient(Client *c); /* draw title and set border of c */
|
||||||
extern unsigned long getcolor(const char *colstr); /* return color of colstr */
|
extern unsigned long getcolor(const char *colstr); /* return color of colstr */
|
||||||
extern void setfont(const char *fontstr); /* set the font for DC */
|
extern void setfont(const char *fontstr); /* set the font for DC */
|
||||||
extern 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*/
|
||||||
@ -159,6 +160,7 @@ extern void dofloat(void); /* arranges all windows floating */
|
|||||||
extern void dotile(void); /* arranges all windows tiled */
|
extern void dotile(void); /* arranges all windows tiled */
|
||||||
extern void focusnext(Arg *arg); /* focuses next visible client, arg is ignored */
|
extern void focusnext(Arg *arg); /* focuses next visible client, arg is ignored */
|
||||||
extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ignored */
|
extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ignored */
|
||||||
|
extern void incnmaster(Arg *arg); /* increments nmaster with arg's index value */
|
||||||
extern Bool isvisible(Client *c); /* returns True if client is visible */
|
extern Bool isvisible(Client *c); /* returns True if client is visible */
|
||||||
extern void resizemaster(Arg *arg); /* resizes the master percent with arg's index value */
|
extern void resizemaster(Arg *arg); /* resizes the master percent with arg's index value */
|
||||||
extern void restack(void); /* restores z layers of all clients */
|
extern void restack(void); /* restores z layers of all clients */
|
||||||
|
8
event.c
8
event.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
@ -236,7 +236,7 @@ expose(XEvent *e) {
|
|||||||
if(barwin == ev->window)
|
if(barwin == ev->window)
|
||||||
drawstatus();
|
drawstatus();
|
||||||
else if((c = getctitle(ev->window)))
|
else if((c = getctitle(ev->window)))
|
||||||
drawtitle(c);
|
drawclient(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,13 +314,13 @@ propertynotify(XEvent *e) {
|
|||||||
arrange();
|
arrange();
|
||||||
break;
|
break;
|
||||||
case XA_WM_NORMAL_HINTS:
|
case XA_WM_NORMAL_HINTS:
|
||||||
updatesize(c);
|
updatesizehints(c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
|
if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) {
|
||||||
updatetitle(c);
|
updatetitle(c);
|
||||||
resizetitle(c);
|
resizetitle(c);
|
||||||
drawtitle(c);
|
drawclient(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
main.c
13
main.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -20,7 +20,7 @@
|
|||||||
char stext[1024];
|
char stext[1024];
|
||||||
Bool *seltag;
|
Bool *seltag;
|
||||||
int bx, by, bw, bh, bmw, masterd, screen, sx, sy, sw, sh, wax, way, waw, wah;
|
int bx, by, bw, bh, bmw, masterd, screen, sx, sy, sw, sh, wax, way, waw, wah;
|
||||||
unsigned int master, ntags, numlockmask;
|
unsigned int master, nmaster, ntags, numlockmask;
|
||||||
Atom wmatom[WMLast], netatom[NetLast];
|
Atom wmatom[WMLast], netatom[NetLast];
|
||||||
Bool running = True;
|
Bool running = True;
|
||||||
Bool issel = True;
|
Bool issel = True;
|
||||||
@ -40,9 +40,9 @@ static Bool otherwm, readin;
|
|||||||
static void
|
static void
|
||||||
cleanup(void) {
|
cleanup(void) {
|
||||||
close(STDIN_FILENO);
|
close(STDIN_FILENO);
|
||||||
while(sel) {
|
while(stack) {
|
||||||
resize(sel, True, TopLeft);
|
resize(stack, True, TopLeft);
|
||||||
unmanage(sel);
|
unmanage(stack);
|
||||||
}
|
}
|
||||||
if(dc.font.set)
|
if(dc.font.set)
|
||||||
XFreeFontSet(dpy, dc.font.set);
|
XFreeFontSet(dpy, dc.font.set);
|
||||||
@ -133,6 +133,7 @@ setup(void) {
|
|||||||
sw = DisplayWidth(dpy, screen);
|
sw = DisplayWidth(dpy, screen);
|
||||||
sh = DisplayHeight(dpy, screen);
|
sh = DisplayHeight(dpy, screen);
|
||||||
master = MASTER;
|
master = MASTER;
|
||||||
|
nmaster = NMASTER;
|
||||||
/* bar */
|
/* bar */
|
||||||
bx = sx;
|
bx = sx;
|
||||||
by = sy;
|
by = sy;
|
||||||
@ -236,7 +237,7 @@ main(int argc, char *argv[]) {
|
|||||||
fd_set rd;
|
fd_set rd;
|
||||||
|
|
||||||
if(argc == 2 && !strncmp("-v", argv[1], 3)) {
|
if(argc == 2 && !strncmp("-v", argv[1], 3)) {
|
||||||
fputs("dwm-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout);
|
fputs("dwm-"VERSION", (C)opyright MMVI-MMVII Anselm R. Garbe\n", stdout);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
else if(argc != 1)
|
else if(argc != 1)
|
||||||
|
2
tag.c
2
tag.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
|
2
util.c
2
util.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
|
45
view.c
45
view.c
@ -1,4 +1,4 @@
|
|||||||
/* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
/* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
|
||||||
* See LICENSE file for license details.
|
* See LICENSE file for license details.
|
||||||
*/
|
*/
|
||||||
#include "dwm.h"
|
#include "dwm.h"
|
||||||
@ -69,13 +69,16 @@ dofloat(void) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
dotile(void) {
|
dotile(void) {
|
||||||
unsigned int i, n, mpx, stackw, th;
|
unsigned int i, n, mw, mh, tw, th;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
|
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
|
||||||
n++;
|
n++;
|
||||||
mpx = (waw * master) / 1000;
|
/* window geoms */
|
||||||
stackw = waw - mpx;
|
mw = (n > nmaster) ? (waw * master) / 1000 : waw;
|
||||||
|
mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
|
||||||
|
tw = waw - mw;
|
||||||
|
th = (n > nmaster) ? wah / (n - nmaster) : 0;
|
||||||
|
|
||||||
for(i = 0, c = clients; c; c = c->next)
|
for(i = 0, c = clients; c; c = c->next)
|
||||||
if(isvisible(c)) {
|
if(isvisible(c)) {
|
||||||
@ -86,20 +89,16 @@ dotile(void) {
|
|||||||
c->ismax = False;
|
c->ismax = False;
|
||||||
c->x = wax;
|
c->x = wax;
|
||||||
c->y = way;
|
c->y = way;
|
||||||
if(n == 1) { /* only 1 window */
|
if(i < nmaster) {
|
||||||
c->w = waw - 2 * BORDERPX;
|
c->y += i * mh;
|
||||||
c->h = wah - 2 * BORDERPX;
|
c->w = mw - 2 * BORDERPX;
|
||||||
}
|
c->h = mh - 2 * BORDERPX;
|
||||||
else if(i == 0) { /* master window */
|
|
||||||
c->w = mpx - 2 * BORDERPX;
|
|
||||||
c->h = wah - 2 * BORDERPX;
|
|
||||||
th = wah / (n - 1);
|
|
||||||
}
|
}
|
||||||
else { /* tile window */
|
else { /* tile window */
|
||||||
c->x += mpx;
|
c->x += mw;
|
||||||
c->w = stackw - 2 * BORDERPX;
|
c->w = tw - 2 * BORDERPX;
|
||||||
if(th > bh) {
|
if(th > bh) {
|
||||||
c->y += (i - 1) * th;
|
c->y += (i - nmaster) * th;
|
||||||
c->h = th - 2 * BORDERPX;
|
c->h = th - 2 * BORDERPX;
|
||||||
}
|
}
|
||||||
else /* fallback if th < bh */
|
else /* fallback if th < bh */
|
||||||
@ -148,6 +147,14 @@ focusprev(Arg *arg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
incnmaster(Arg *arg) {
|
||||||
|
if((nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
|
||||||
|
return;
|
||||||
|
nmaster += arg->i;
|
||||||
|
arrange();
|
||||||
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
isvisible(Client *c) {
|
isvisible(Client *c) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -250,11 +257,9 @@ zoom(Arg *arg) {
|
|||||||
togglemax(sel);
|
togglemax(sel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for(n = 0, c = clients; c; c = c->next)
|
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
|
||||||
if(isvisible(c) && !c->isfloat)
|
n++;
|
||||||
n++;
|
|
||||||
if(n < 2 || (arrange == dofloat))
|
|
||||||
return;
|
|
||||||
if((c = sel) == nexttiled(clients))
|
if((c = sel) == nexttiled(clients))
|
||||||
if(!(c = nexttiled(c->next)))
|
if(!(c = nexttiled(c->next)))
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user