diff options
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | README | 17 | ||||
| -rw-r--r-- | client.c | 6 | ||||
| -rw-r--r-- | config.mk | 24 | ||||
| -rw-r--r-- | dwm.1 | 24 | ||||
| -rw-r--r-- | dwm.h | 8 | ||||
| -rw-r--r-- | event.c | 14 | ||||
| -rw-r--r-- | tag.c | 4 |
8 files changed, 42 insertions, 58 deletions
| @@ -13,7 +13,6 @@ all: options dwm | |||
| 13 | 13 | ||
| 14 | options: | 14 | options: |
| 15 | @echo dwm build options: | 15 | @echo dwm build options: |
| 16 | @echo "LIBS = ${LIBS}" | ||
| 17 | @echo "CFLAGS = ${CFLAGS}" | 16 | @echo "CFLAGS = ${CFLAGS}" |
| 18 | @echo "LDFLAGS = ${LDFLAGS}" | 17 | @echo "LDFLAGS = ${LDFLAGS}" |
| 19 | @echo "CC = ${CC}" | 18 | @echo "CC = ${CC}" |
| @@ -29,7 +28,7 @@ dwm: ${OBJ} | |||
| 29 | @${CC} -o $@ ${OBJ} ${LDFLAGS} | 28 | @${CC} -o $@ ${OBJ} ${LDFLAGS} |
| 30 | 29 | ||
| 31 | clean: | 30 | clean: |
| 32 | rm -f dwm *.o core dwm-${VERSION}.tar.gz | 31 | rm -f dwm *.o dwm-${VERSION}.tar.gz |
| 33 | 32 | ||
| 34 | dist: clean | 33 | dist: clean |
| 35 | mkdir -p dwm-${VERSION} | 34 | mkdir -p dwm-${VERSION} |
| @@ -1,6 +1,6 @@ | |||
| 1 | dwm - dynamic window manager | 1 | dwm - dynamic window manager |
| 2 | ---------------------------- | 2 | ---------------------------- |
| 3 | dwm is an extremly fast, small, and dynamic X11 window manager. | 3 | dwm is an extremely fast, small, and dynamic X11 window manager. |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | Requirements | 6 | Requirements |
| @@ -10,8 +10,8 @@ In order to build dwm you need the Xlib header files. | |||
| 10 | 10 | ||
| 11 | Installation | 11 | Installation |
| 12 | ------------ | 12 | ------------ |
| 13 | Edit config.mk to match your local setup. dwm is installed into | 13 | Edit config.mk to match your local setup (dwm is installed into |
| 14 | the /usr/local namespace by default. | 14 | the /usr/local namespace by default). |
| 15 | 15 | ||
| 16 | Afterwards enter the following command to build and install dwm (if | 16 | Afterwards enter the following command to build and install dwm (if |
| 17 | necessary as root): | 17 | necessary as root): |
| @@ -35,16 +35,17 @@ This will start dwm on display :1 of the host foo.bar. | |||
| 35 | 35 | ||
| 36 | Displaying status info | 36 | Displaying status info |
| 37 | ---------------------- | 37 | ---------------------- |
| 38 | In order to display status info in the bar, you can do following | 38 | In order to display status info in the bar, you can do something |
| 39 | in .xinitrc: | 39 | like this in your .xinitrc: |
| 40 | 40 | ||
| 41 | while true | 41 | while true |
| 42 | do | 42 | do |
| 43 | echo `date` `uptime | sed 's/.*://; s/,//g'` | 43 | echo `date` `uptime | sed 's/.*://; s/,//g'` |
| 44 | sleep 2 | 44 | sleep 1 |
| 45 | done | dwm | 45 | done | dwm |
| 46 | 46 | ||
| 47 | |||
| 47 | Configuration | 48 | Configuration |
| 48 | ------------- | 49 | ------------- |
| 49 | The configuration of dwm is done by customizing source code, | 50 | The configuration of dwm is done by customizing its source code |
| 50 | grep for CUSTOMIZE keyword. | 51 | (grep for the CUSTOMIZE keyword). |
| @@ -244,11 +244,11 @@ manage(Window w, XWindowAttributes *wa) | |||
| 244 | c->next = clients; | 244 | c->next = clients; |
| 245 | clients = c; | 245 | clients = c; |
| 246 | 246 | ||
| 247 | XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonPressMask, | 247 | XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonMask, |
| 248 | GrabModeAsync, GrabModeSync, None, None); | 248 | GrabModeAsync, GrabModeSync, None, None); |
| 249 | XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonPressMask, | 249 | XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonMask, |
| 250 | GrabModeAsync, GrabModeSync, None, None); | 250 | GrabModeAsync, GrabModeSync, None, None); |
| 251 | XGrabButton(dpy, Button3, MODKEY, c->win, False, ButtonPressMask, | 251 | XGrabButton(dpy, Button3, MODKEY, c->win, False, ButtonMask, |
| 252 | GrabModeAsync, GrabModeSync, None, None); | 252 | GrabModeAsync, GrabModeSync, None, None); |
| 253 | 253 | ||
| 254 | if(!c->isfloat) | 254 | if(!c->isfloat) |
| @@ -7,24 +7,18 @@ MANPREFIX = ${PREFIX}/share/man | |||
| 7 | X11INC = /usr/X11R6/include | 7 | X11INC = /usr/X11R6/include |
| 8 | X11LIB = /usr/X11R6/lib | 8 | X11LIB = /usr/X11R6/lib |
| 9 | 9 | ||
| 10 | VERSION = 0.5 | ||
| 11 | |||
| 12 | # includes and libs | 10 | # includes and libs |
| 13 | LIBS = -L${PREFIX}/lib -L/usr/lib -lc -L${X11LIB} -lX11 | 11 | INCS = -I/usr/lib -I${X11INC} |
| 12 | LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 | ||
| 14 | 13 | ||
| 15 | # Linux/BSD | 14 | # flags |
| 16 | CFLAGS = -O3 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ | 15 | CFLAGS = -O3 ${INCS} -DVERSION=\"${VERSION}\" |
| 17 | -DVERSION=\"${VERSION}\" | ||
| 18 | LDFLAGS = ${LIBS} | 16 | LDFLAGS = ${LIBS} |
| 19 | #CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ | 17 | #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" |
| 20 | # -DVERSION=\"${VERSION}\" | ||
| 21 | #LDFLAGS = -g ${LIBS} | 18 | #LDFLAGS = -g ${LIBS} |
| 22 | 19 | ||
| 23 | 20 | # compiler | |
| 24 | # Solaris | ||
| 25 | #CFLAGS = -fast -xtarget=ultra ${INCLUDES} -DVERSION=\"${VERSION}\" | ||
| 26 | #LIBS += -lnsl -lsocket | ||
| 27 | |||
| 28 | AR = ar cr | ||
| 29 | CC = cc | 21 | CC = cc |
| 30 | RANLIB = ranlib | 22 | |
| 23 | # dwm version | ||
| 24 | VERSION = 0.6 | ||
| @@ -21,7 +21,7 @@ time. But each window may contain more than one tag, which makes it visible in | |||
| 21 | several views. | 21 | several views. |
| 22 | .P | 22 | .P |
| 23 | .B dwm | 23 | .B dwm |
| 24 | consists of a small status bar which reads the text displayed from standard | 24 | has a small status bar which reads the text displayed from standard |
| 25 | input, if written. It draws 1-pixel borders around windows to indicate the | 25 | input, if written. It draws 1-pixel borders around windows to indicate the |
| 26 | focus state. Unfocused windows contain a small bar in front of the window | 26 | focus state. Unfocused windows contain a small bar in front of the window |
| 27 | displaying the tags and the window title. | 27 | displaying the tags and the window title. |
| @@ -56,14 +56,12 @@ Focus | |||
| 56 | tag | 56 | tag |
| 57 | .TP | 57 | .TP |
| 58 | .B Mod1-space | 58 | .B Mod1-space |
| 59 | (Re-)arrange | 59 | Toggle between |
| 60 | .B all | 60 | .B tiled |
| 61 | windows tiled | 61 | and |
| 62 | .TP | 62 | .B floating |
| 63 | .B Mod1-Shift-space | 63 | mode (affects |
| 64 | (Re-)arrange | 64 | .BR "all windows" ) |
| 65 | .B all | ||
| 66 | windows floating | ||
| 67 | .TP | 65 | .TP |
| 68 | .B Mod1-Shift-[0..n] | 66 | .B Mod1-Shift-[0..n] |
| 69 | Apply | 67 | Apply |
| @@ -79,14 +77,6 @@ Quit | |||
| 79 | Start | 77 | Start |
| 80 | .B terminal | 78 | .B terminal |
| 81 | .TP | 79 | .TP |
| 82 | .B Mod1-Shift-w | ||
| 83 | Start | ||
| 84 | .B web browser | ||
| 85 | .TP | ||
| 86 | .B Mod1-Shift-l | ||
| 87 | Lock | ||
| 88 | .B screen | ||
| 89 | .TP | ||
| 90 | .B Mod1-Control-[0..n] | 80 | .B Mod1-Control-[0..n] |
| 91 | Append | 81 | Append |
| 92 | .B nth | 82 | .B nth |
| @@ -25,9 +25,12 @@ enum { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast }; | |||
| 25 | 25 | ||
| 26 | /* END CUSTOMIZE */ | 26 | /* END CUSTOMIZE */ |
| 27 | 27 | ||
| 28 | /* mask shorthands, used in event.c and client.c */ | ||
| 29 | #define ButtonMask (ButtonPressMask | ButtonReleaseMask) | ||
| 30 | #define MouseMask (ButtonMask | PointerMotionMask) | ||
| 31 | |||
| 28 | typedef union Arg Arg; | 32 | typedef union Arg Arg; |
| 29 | typedef struct Client Client; | 33 | typedef struct Client Client; |
| 30 | typedef enum Corner Corner; | ||
| 31 | typedef struct DC DC; | 34 | typedef struct DC DC; |
| 32 | typedef struct Fnt Fnt; | 35 | typedef struct Fnt Fnt; |
| 33 | 36 | ||
| @@ -43,7 +46,8 @@ enum { WMProtocols, WMDelete, WMLast }; | |||
| 43 | /* cursor */ | 46 | /* cursor */ |
| 44 | enum { CurNormal, CurResize, CurMove, CurLast }; | 47 | enum { CurNormal, CurResize, CurMove, CurLast }; |
| 45 | 48 | ||
| 46 | enum Corner { TopLeft, TopRight, BotLeft, BotRight }; | 49 | /* windowcorners */ |
| 50 | typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner; | ||
| 47 | 51 | ||
| 48 | struct Fnt { | 52 | struct Fnt { |
| 49 | int ascent; | 53 | int ascent; |
| @@ -8,9 +8,6 @@ | |||
| 8 | #include <X11/keysym.h> | 8 | #include <X11/keysym.h> |
| 9 | #include <X11/Xatom.h> | 9 | #include <X11/Xatom.h> |
| 10 | 10 | ||
| 11 | #define ButtonMask (ButtonPressMask | ButtonReleaseMask) | ||
| 12 | #define MouseMask (ButtonMask | PointerMotionMask) | ||
| 13 | |||
| 14 | /* CUSTOMIZE */ | 11 | /* CUSTOMIZE */ |
| 15 | 12 | ||
| 16 | typedef struct { | 13 | typedef struct { |
| @@ -20,17 +17,13 @@ typedef struct { | |||
| 20 | Arg arg; | 17 | Arg arg; |
| 21 | } Key; | 18 | } Key; |
| 22 | 19 | ||
| 23 | /* | ||
| 24 | const char *browse[] = { "firefox", NULL }; | 20 | const char *browse[] = { "firefox", NULL }; |
| 25 | const char *gimp[] = { "gimp", NULL }; | 21 | const char *gimp[] = { "gimp", NULL }; |
| 26 | */ | 22 | const char *term[] = { /*"xterm", NULL };*/ |
| 27 | const char *term[] = { "xterm", NULL }; | ||
| 28 | /* | ||
| 29 | "urxvt", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white", | 23 | "urxvt", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white", |
| 30 | "-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL | 24 | "-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL |
| 31 | }; | 25 | }; |
| 32 | const char *xlock[] = { "xlock", NULL }; | 26 | const char *xlock[] = { "xlock", NULL }; |
| 33 | */ | ||
| 34 | 27 | ||
| 35 | static Key key[] = { | 28 | static Key key[] = { |
| 36 | /* modifier key function arguments */ | 29 | /* modifier key function arguments */ |
| @@ -57,11 +50,9 @@ static Key key[] = { | |||
| 57 | { MODKEY|ShiftMask, XK_c, killclient, { 0 } }, | 50 | { MODKEY|ShiftMask, XK_c, killclient, { 0 } }, |
| 58 | { MODKEY|ShiftMask, XK_q, quit, { 0 } }, | 51 | { MODKEY|ShiftMask, XK_q, quit, { 0 } }, |
| 59 | { MODKEY|ShiftMask, XK_Return, spawn, { .argv = term } }, | 52 | { MODKEY|ShiftMask, XK_Return, spawn, { .argv = term } }, |
| 60 | /* | ||
| 61 | { MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } }, | 53 | { MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } }, |
| 62 | { MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } }, | 54 | { MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } }, |
| 63 | { MODKEY|ShiftMask, XK_w, spawn, { .argv = browse } }, | 55 | { MODKEY|ShiftMask, XK_w, spawn, { .argv = browse } }, |
| 64 | */ | ||
| 65 | }; | 56 | }; |
| 66 | 57 | ||
| 67 | /* END CUSTOMIZE */ | 58 | /* END CUSTOMIZE */ |
| @@ -172,6 +163,7 @@ buttonpress(XEvent *e) | |||
| 172 | } | 163 | } |
| 173 | } | 164 | } |
| 174 | else if((c = getclient(ev->window))) { | 165 | else if((c = getclient(ev->window))) { |
| 166 | focus(c); | ||
| 175 | switch(ev->button) { | 167 | switch(ev->button) { |
| 176 | default: | 168 | default: |
| 177 | break; | 169 | break; |
| @@ -247,7 +239,7 @@ enternotify(XEvent *e) | |||
| 247 | Client *c; | 239 | Client *c; |
| 248 | XCrossingEvent *ev = &e->xcrossing; | 240 | XCrossingEvent *ev = &e->xcrossing; |
| 249 | 241 | ||
| 250 | if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) | 242 | if(ev->detail == NotifyInferior) |
| 251 | return; | 243 | return; |
| 252 | 244 | ||
| 253 | if((c = getclient(ev->window))) | 245 | if((c = getclient(ev->window))) |
| @@ -67,6 +67,8 @@ dofloat(Arg *arg) | |||
| 67 | higher(sel); | 67 | higher(sel); |
| 68 | focus(sel); | 68 | focus(sel); |
| 69 | } | 69 | } |
| 70 | else | ||
| 71 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); | ||
| 70 | } | 72 | } |
| 71 | drawall(); | 73 | drawall(); |
| 72 | } | 74 | } |
| @@ -130,6 +132,8 @@ dotile(Arg *arg) | |||
| 130 | higher(sel); | 132 | higher(sel); |
| 131 | focus(sel); | 133 | focus(sel); |
| 132 | } | 134 | } |
| 135 | else | ||
| 136 | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); | ||
| 133 | } | 137 | } |
| 134 | drawall(); | 138 | drawall(); |
| 135 | } | 139 | } |
