summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-08-01 12:32:33 +0200
committerarg@10ksloc.org <unknown>2006-08-01 12:32:33 +0200
commit7b5638f61d5c8b5a76bc3f7a5962cb7490da3b6b (patch)
tree4f002a641211db4af64bd925497d56469082b712
parentcommitted a patch which fixes the hints of Jukka (diff)
downloaddwm-7b5638f61d5c8b5a76bc3f7a5962cb7490da3b6b.tar.gz
dwm-7b5638f61d5c8b5a76bc3f7a5962cb7490da3b6b.zip
applied Sanders patches
Diffstat (limited to '')
-rw-r--r--Makefile3
-rw-r--r--README17
-rw-r--r--client.c6
-rw-r--r--config.mk24
-rw-r--r--dwm.124
-rw-r--r--dwm.h8
-rw-r--r--event.c14
-rw-r--r--tag.c4
8 files changed, 42 insertions, 58 deletions
diff --git a/Makefile b/Makefile
index da0d71c..77f75e6 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,6 @@ all: options dwm
13 13
14options: 14options:
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
31clean: 30clean:
32 rm -f dwm *.o core dwm-${VERSION}.tar.gz 31 rm -f dwm *.o dwm-${VERSION}.tar.gz
33 32
34dist: clean 33dist: clean
35 mkdir -p dwm-${VERSION} 34 mkdir -p dwm-${VERSION}
diff --git a/README b/README
index 89f7dba..f7721cf 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
1dwm - dynamic window manager 1dwm - dynamic window manager
2---------------------------- 2----------------------------
3dwm is an extremly fast, small, and dynamic X11 window manager. 3dwm is an extremely fast, small, and dynamic X11 window manager.
4 4
5 5
6Requirements 6Requirements
@@ -10,8 +10,8 @@ In order to build dwm you need the Xlib header files.
10 10
11Installation 11Installation
12------------ 12------------
13Edit config.mk to match your local setup. dwm is installed into 13Edit config.mk to match your local setup (dwm is installed into
14the /usr/local namespace by default. 14the /usr/local namespace by default).
15 15
16Afterwards enter the following command to build and install dwm (if 16Afterwards enter the following command to build and install dwm (if
17necessary as root): 17necessary as root):
@@ -35,16 +35,17 @@ This will start dwm on display :1 of the host foo.bar.
35 35
36Displaying status info 36Displaying status info
37---------------------- 37----------------------
38In order to display status info in the bar, you can do following 38In order to display status info in the bar, you can do something
39in .xinitrc: 39like 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
47Configuration 48Configuration
48------------- 49-------------
49The configuration of dwm is done by customizing source code, 50The configuration of dwm is done by customizing its source code
50grep for CUSTOMIZE keyword. 51(grep for the CUSTOMIZE keyword).
diff --git a/client.c b/client.c
index 45acf2e..646bcc1 100644
--- a/client.c
+++ b/client.c
@@ -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)
diff --git a/config.mk b/config.mk
index 605f462..d4ae17e 100644
--- a/config.mk
+++ b/config.mk
@@ -7,24 +7,18 @@ MANPREFIX = ${PREFIX}/share/man
7X11INC = /usr/X11R6/include 7X11INC = /usr/X11R6/include
8X11LIB = /usr/X11R6/lib 8X11LIB = /usr/X11R6/lib
9 9
10VERSION = 0.5
11
12# includes and libs 10# includes and libs
13LIBS = -L${PREFIX}/lib -L/usr/lib -lc -L${X11LIB} -lX11 11INCS = -I/usr/lib -I${X11INC}
12LIBS = -L/usr/lib -lc -L${X11LIB} -lX11
14 13
15# Linux/BSD 14# flags
16CFLAGS = -O3 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ 15CFLAGS = -O3 ${INCS} -DVERSION=\"${VERSION}\"
17 -DVERSION=\"${VERSION}\"
18LDFLAGS = ${LIBS} 16LDFLAGS = ${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
28AR = ar cr
29CC = cc 21CC = cc
30RANLIB = ranlib 22
23# dwm version
24VERSION = 0.6
diff --git a/dwm.1 b/dwm.1
index a023d4a..3f1f75a 100644
--- a/dwm.1
+++ b/dwm.1
@@ -21,7 +21,7 @@ time. But each window may contain more than one tag, which makes it visible in
21several views. 21several views.
22.P 22.P
23.B dwm 23.B dwm
24consists of a small status bar which reads the text displayed from standard 24has a small status bar which reads the text displayed from standard
25input, if written. It draws 1-pixel borders around windows to indicate the 25input, if written. It draws 1-pixel borders around windows to indicate the
26focus state. Unfocused windows contain a small bar in front of the window 26focus state. Unfocused windows contain a small bar in front of the window
27displaying the tags and the window title. 27displaying the tags and the window title.
@@ -56,14 +56,12 @@ Focus
56tag 56tag
57.TP 57.TP
58.B Mod1-space 58.B Mod1-space
59(Re-)arrange 59Toggle between
60.B all 60.B tiled
61windows tiled 61and
62.TP 62.B floating
63.B Mod1-Shift-space 63mode (affects
64(Re-)arrange 64.BR "all windows" )
65.B all
66windows floating
67.TP 65.TP
68.B Mod1-Shift-[0..n] 66.B Mod1-Shift-[0..n]
69Apply 67Apply
@@ -79,14 +77,6 @@ Quit
79Start 77Start
80.B terminal 78.B terminal
81.TP 79.TP
82.B Mod1-Shift-w
83Start
84.B web browser
85.TP
86.B Mod1-Shift-l
87Lock
88.B screen
89.TP
90.B Mod1-Control-[0..n] 80.B Mod1-Control-[0..n]
91Append 81Append
92.B nth 82.B nth
diff --git a/dwm.h b/dwm.h
index d18ef20..bcdb4e3 100644
--- a/dwm.h
+++ b/dwm.h
@@ -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
28typedef union Arg Arg; 32typedef union Arg Arg;
29typedef struct Client Client; 33typedef struct Client Client;
30typedef enum Corner Corner;
31typedef struct DC DC; 34typedef struct DC DC;
32typedef struct Fnt Fnt; 35typedef struct Fnt Fnt;
33 36
@@ -43,7 +46,8 @@ enum { WMProtocols, WMDelete, WMLast };
43/* cursor */ 46/* cursor */
44enum { CurNormal, CurResize, CurMove, CurLast }; 47enum { CurNormal, CurResize, CurMove, CurLast };
45 48
46enum Corner { TopLeft, TopRight, BotLeft, BotRight }; 49/* windowcorners */
50typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner;
47 51
48struct Fnt { 52struct Fnt {
49 int ascent; 53 int ascent;
diff --git a/event.c b/event.c
index 285b37e..17be71d 100644
--- a/event.c
+++ b/event.c
@@ -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
16typedef struct { 13typedef struct {
@@ -20,17 +17,13 @@ typedef struct {
20 Arg arg; 17 Arg arg;
21} Key; 18} Key;
22 19
23/*
24const char *browse[] = { "firefox", NULL }; 20const char *browse[] = { "firefox", NULL };
25const char *gimp[] = { "gimp", NULL }; 21const char *gimp[] = { "gimp", NULL };
26*/ 22const char *term[] = { /*"xterm", NULL };*/
27const 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};
32const char *xlock[] = { "xlock", NULL }; 26const char *xlock[] = { "xlock", NULL };
33*/
34 27
35static Key key[] = { 28static 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)))
diff --git a/tag.c b/tag.c
index 13e22af..c42a760 100644
--- a/tag.c
+++ b/tag.c
@@ -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}