applied Sanders patches
7b5638f6
8 file(s) · +42 −58
| 13 | 13 | ||
| 14 | 14 | options: |
|
| 15 | 15 | @echo dwm build options: |
|
| 16 | - | @echo "LIBS = ${LIBS}" |
|
| 17 | 16 | @echo "CFLAGS = ${CFLAGS}" |
|
| 18 | 17 | @echo "LDFLAGS = ${LDFLAGS}" |
|
| 19 | 18 | @echo "CC = ${CC}" |
|
| 29 | 28 | @${CC} -o $@ ${OBJ} ${LDFLAGS} |
|
| 30 | 29 | ||
| 31 | 30 | clean: |
|
| 32 | - | rm -f dwm *.o core dwm-${VERSION}.tar.gz |
|
| 31 | + | rm -f dwm *.o dwm-${VERSION}.tar.gz |
|
| 33 | 32 | ||
| 34 | 33 | dist: clean |
|
| 35 | 34 | mkdir -p dwm-${VERSION} |
|
| 1 | 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 | 6 | Requirements |
|
| 10 | 10 | ||
| 11 | 11 | Installation |
|
| 12 | 12 | ------------ |
|
| 13 | - | Edit config.mk to match your local setup. dwm is installed into |
|
| 14 | - | the /usr/local namespace by default. |
|
| 13 | + | Edit config.mk to match your local setup (dwm is installed into |
|
| 14 | + | the /usr/local namespace by default). |
|
| 15 | 15 | ||
| 16 | 16 | Afterwards enter the following command to build and install dwm (if |
|
| 17 | 17 | necessary as root): |
|
| 35 | 35 | ||
| 36 | 36 | Displaying status info |
|
| 37 | 37 | ---------------------- |
|
| 38 | - | In order to display status info in the bar, you can do following |
|
| 39 | - | in .xinitrc: |
|
| 38 | + | In order to display status info in the bar, you can do something |
|
| 39 | + | like this in your .xinitrc: |
|
| 40 | 40 | ||
| 41 | 41 | while true |
|
| 42 | 42 | do |
|
| 43 | 43 | echo `date` `uptime | sed 's/.*://; s/,//g'` |
|
| 44 | - | sleep 2 |
|
| 44 | + | sleep 1 |
|
| 45 | 45 | done | dwm |
|
| 46 | + | ||
| 46 | 47 | ||
| 47 | 48 | Configuration |
|
| 48 | 49 | ------------- |
|
| 49 | - | The configuration of dwm is done by customizing source code, |
|
| 50 | - | grep for CUSTOMIZE keyword. |
|
| 50 | + | The configuration of dwm is done by customizing its source code |
|
| 51 | + | (grep for the CUSTOMIZE keyword). |
|
| 244 | 244 | c->next = clients; |
|
| 245 | 245 | clients = c; |
|
| 246 | 246 | ||
| 247 | - | XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonPressMask, |
|
| 247 | + | XGrabButton(dpy, Button1, MODKEY, c->win, False, ButtonMask, |
|
| 248 | 248 | GrabModeAsync, GrabModeSync, None, None); |
|
| 249 | - | XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonPressMask, |
|
| 249 | + | XGrabButton(dpy, Button2, MODKEY, c->win, False, ButtonMask, |
|
| 250 | 250 | GrabModeAsync, GrabModeSync, None, None); |
|
| 251 | - | XGrabButton(dpy, Button3, MODKEY, c->win, False, ButtonPressMask, |
|
| 251 | + | XGrabButton(dpy, Button3, MODKEY, c->win, False, ButtonMask, |
|
| 252 | 252 | GrabModeAsync, GrabModeSync, None, None); |
|
| 253 | 253 | ||
| 254 | 254 | if(!c->isfloat) |
| 7 | 7 | X11INC = /usr/X11R6/include |
|
| 8 | 8 | X11LIB = /usr/X11R6/lib |
|
| 9 | 9 | ||
| 10 | - | VERSION = 0.5 |
|
| 11 | - | ||
| 12 | 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 |
|
| 16 | - | CFLAGS = -O3 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ |
|
| 17 | - | -DVERSION=\"${VERSION}\" |
|
| 14 | + | # flags |
|
| 15 | + | CFLAGS = -O3 ${INCS} -DVERSION=\"${VERSION}\" |
|
| 18 | 16 | LDFLAGS = ${LIBS} |
|
| 19 | - | #CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ |
|
| 20 | - | # -DVERSION=\"${VERSION}\" |
|
| 17 | + | #CFLAGS = -g -Wall -O2 ${INCS} -DVERSION=\"${VERSION}\" |
|
| 21 | 18 | #LDFLAGS = -g ${LIBS} |
|
| 22 | 19 | ||
| 23 | - | ||
| 24 | - | # Solaris |
|
| 25 | - | #CFLAGS = -fast -xtarget=ultra ${INCLUDES} -DVERSION=\"${VERSION}\" |
|
| 26 | - | #LIBS += -lnsl -lsocket |
|
| 27 | - | ||
| 28 | - | AR = ar cr |
|
| 20 | + | # compiler |
|
| 29 | 21 | CC = cc |
|
| 30 | - | RANLIB = ranlib |
|
| 22 | + | ||
| 23 | + | # dwm version |
|
| 24 | + | VERSION = 0.6 |
| 21 | 21 | several views. |
|
| 22 | 22 | .P |
|
| 23 | 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 | 25 | input, if written. It draws 1-pixel borders around windows to indicate the |
|
| 26 | 26 | focus state. Unfocused windows contain a small bar in front of the window |
|
| 27 | 27 | displaying the tags and the window title. |
|
| 56 | 56 | tag |
|
| 57 | 57 | .TP |
|
| 58 | 58 | .B Mod1-space |
|
| 59 | - | (Re-)arrange |
|
| 60 | - | .B all |
|
| 61 | - | windows tiled |
|
| 62 | - | .TP |
|
| 63 | - | .B Mod1-Shift-space |
|
| 64 | - | (Re-)arrange |
|
| 65 | - | .B all |
|
| 66 | - | windows floating |
|
| 59 | + | Toggle between |
|
| 60 | + | .B tiled |
|
| 61 | + | and |
|
| 62 | + | .B floating |
|
| 63 | + | mode (affects |
|
| 64 | + | .BR "all windows" ) |
|
| 67 | 65 | .TP |
|
| 68 | 66 | .B Mod1-Shift-[0..n] |
|
| 69 | 67 | Apply |
|
| 78 | 76 | .B Mod1-Shift-Return |
|
| 79 | 77 | Start |
|
| 80 | 78 | .B terminal |
|
| 81 | - | .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 | 79 | .TP |
|
| 90 | 80 | .B Mod1-Control-[0..n] |
|
| 91 | 81 | Append |
|
| 25 | 25 | ||
| 26 | 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 | 32 | typedef union Arg Arg; |
|
| 29 | 33 | typedef struct Client Client; |
|
| 30 | - | typedef enum Corner Corner; |
|
| 31 | 34 | typedef struct DC DC; |
|
| 32 | 35 | typedef struct Fnt Fnt; |
|
| 33 | 36 | ||
| 43 | 46 | /* cursor */ |
|
| 44 | 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 | 52 | struct Fnt { |
|
| 49 | 53 | int ascent; |
|
| 8 | 8 | #include <X11/keysym.h> |
|
| 9 | 9 | #include <X11/Xatom.h> |
|
| 10 | 10 | ||
| 11 | - | #define ButtonMask (ButtonPressMask | ButtonReleaseMask) |
|
| 12 | - | #define MouseMask (ButtonMask | PointerMotionMask) |
|
| 13 | - | ||
| 14 | 11 | /* CUSTOMIZE */ |
|
| 15 | 12 | ||
| 16 | 13 | typedef struct { |
|
| 20 | 17 | Arg arg; |
|
| 21 | 18 | } Key; |
|
| 22 | 19 | ||
| 23 | - | /* |
|
| 24 | 20 | const char *browse[] = { "firefox", NULL }; |
|
| 25 | 21 | const char *gimp[] = { "gimp", NULL }; |
|
| 26 | - | */ |
|
| 27 | - | const char *term[] = { "xterm", NULL }; |
|
| 28 | - | /* |
|
| 22 | + | const char *term[] = { /*"xterm", NULL };*/ |
|
| 29 | 23 | "urxvt", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white", |
|
| 30 | 24 | "-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL |
|
| 31 | 25 | }; |
|
| 32 | 26 | const char *xlock[] = { "xlock", NULL }; |
|
| 33 | - | */ |
|
| 34 | 27 | ||
| 35 | 28 | static Key key[] = { |
|
| 36 | 29 | /* modifier key function arguments */ |
|
| 57 | 50 | { MODKEY|ShiftMask, XK_c, killclient, { 0 } }, |
|
| 58 | 51 | { MODKEY|ShiftMask, XK_q, quit, { 0 } }, |
|
| 59 | 52 | { MODKEY|ShiftMask, XK_Return, spawn, { .argv = term } }, |
|
| 60 | - | /* |
|
| 61 | 53 | { MODKEY|ShiftMask, XK_g, spawn, { .argv = gimp } }, |
|
| 62 | 54 | { MODKEY|ShiftMask, XK_l, spawn, { .argv = xlock } }, |
|
| 63 | 55 | { MODKEY|ShiftMask, XK_w, spawn, { .argv = browse } }, |
|
| 64 | - | */ |
|
| 65 | 56 | }; |
|
| 66 | 57 | ||
| 67 | 58 | /* END CUSTOMIZE */ |
|
| 172 | 163 | } |
|
| 173 | 164 | } |
|
| 174 | 165 | else if((c = getclient(ev->window))) { |
|
| 166 | + | focus(c); |
|
| 175 | 167 | switch(ev->button) { |
|
| 176 | 168 | default: |
|
| 177 | 169 | break; |
|
| 247 | 239 | Client *c; |
|
| 248 | 240 | XCrossingEvent *ev = &e->xcrossing; |
|
| 249 | 241 | ||
| 250 | - | if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) |
|
| 242 | + | if(ev->detail == NotifyInferior) |
|
| 251 | 243 | return; |
|
| 252 | 244 | ||
| 253 | 245 | if((c = getclient(ev->window))) |
|
| 67 | 67 | higher(sel); |
|
| 68 | 68 | focus(sel); |
|
| 69 | 69 | } |
|
| 70 | + | else |
|
| 71 | + | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); |
|
| 70 | 72 | } |
|
| 71 | 73 | drawall(); |
|
| 72 | 74 | } |
|
| 130 | 132 | higher(sel); |
|
| 131 | 133 | focus(sel); |
|
| 132 | 134 | } |
|
| 135 | + | else |
|
| 136 | + | XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); |
|
| 133 | 137 | } |
|
| 134 | 138 | drawall(); |
|
| 135 | 139 | } |
|