summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-22 17:43:41 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-22 17:43:41 +0100
commit587100873a66e34251041678504a8c1e28410591 (patch)
tree2ea60a457951a9f21be2deaf0b29244d4cc7c5a9
parentmerged focus{prev.next} into focusclient(1/-1) (diff)
downloaddwm-587100873a66e34251041678504a8c1e28410591.tar.gz
dwm-587100873a66e34251041678504a8c1e28410591.zip
renamed versatile into untiled
-rw-r--r--client.c10
-rw-r--r--config.arg.h8
-rw-r--r--config.default.h8
-rw-r--r--draw.c2
-rw-r--r--dwm.138
-rw-r--r--dwm.h8
-rw-r--r--event.c8
-rw-r--r--layout.c16
-rw-r--r--tag.c4
9 files changed, 51 insertions, 51 deletions
diff --git a/client.c b/client.c
index 2e443c2..4ba15c4 100644
--- a/client.c
+++ b/client.c
@@ -203,8 +203,8 @@ manage(Window w, XWindowAttributes *wa) {
203 updatetitle(c); 203 updatetitle(c);
204 for(t = clients; t && t->win != trans; t = t->next); 204 for(t = clients; t && t->win != trans; t = t->next);
205 settags(c, t); 205 settags(c, t);
206 if(!c->isversatile) 206 if(!c->isuntiled)
207 c->isversatile = (t != NULL) || c->isfixed; 207 c->isuntiled = (t != NULL) || c->isfixed;
208 attach(c); 208 attach(c);
209 attachstack(c); 209 attachstack(c);
210 c->isbanned = True; 210 c->isbanned = True;
@@ -285,10 +285,10 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) {
285} 285}
286 286
287void 287void
288toggleversatile(const char *arg) { 288toggletiled(const char *arg) {
289 if(!sel || lt->arrange == versatile) 289 if(!sel || lt->arrange == untile)
290 return; 290 return;
291 sel->isversatile = !sel->isversatile; 291 sel->isuntiled = !sel->isuntiled;
292 lt->arrange(); 292 lt->arrange();
293} 293}
294 294
diff --git a/config.arg.h b/config.arg.h
index 0740e00..72a74bf 100644
--- a/config.arg.h
+++ b/config.arg.h
@@ -18,7 +18,7 @@
18const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL }; 18const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
19#define RULES \ 19#define RULES \
20static Rule rule[] = { \ 20static Rule rule[] = { \
21 /* class:instance:title regex tags regex isversatile */ \ 21 /* class:instance:title regex tags regex isuntiled */ \
22 { "Firefox", "3", False }, \ 22 { "Firefox", "3", False }, \
23 { "Gimp", NULL, True }, \ 23 { "Gimp", NULL, True }, \
24 { "MPlayer", NULL, True }, \ 24 { "MPlayer", NULL, True }, \
@@ -30,11 +30,11 @@ static Rule rule[] = { \
30static Layout layout[] = { \ 30static Layout layout[] = { \
31 /* symbol function */ \ 31 /* symbol function */ \
32 { "[]=", tile }, /* first entry is default */ \ 32 { "[]=", tile }, /* first entry is default */ \
33 { "><>", versatile }, \ 33 { "><>", untile }, \
34}; 34};
35#define MASTERWIDTH 600 /* master width per thousand */ 35#define MASTERWIDTH 600 /* master width per thousand */
36#define NMASTER 1 /* clients in master area */ 36#define NMASTER 1 /* clients in master area */
37#define SNAP 40 /* versatile snap pixel */ 37#define SNAP 40 /* untiled snap pixel */
38 38
39/* key definitions */ 39/* key definitions */
40#define MODKEY Mod1Mask 40#define MODKEY Mod1Mask
@@ -56,7 +56,7 @@ static Key key[] = { \
56 { MODKEY, XK_k, focusclient, "-1" }, \ 56 { MODKEY, XK_k, focusclient, "-1" }, \
57 { MODKEY, XK_m, togglemax, NULL }, \ 57 { MODKEY, XK_m, togglemax, NULL }, \
58 { MODKEY, XK_Return, zoom, NULL }, \ 58 { MODKEY, XK_Return, zoom, NULL }, \
59 { MODKEY|ShiftMask, XK_space, toggleversatile,NULL }, \ 59 { MODKEY|ShiftMask, XK_space, toggletiled, NULL }, \
60 { MODKEY|ShiftMask, XK_c, killclient, NULL }, \ 60 { MODKEY|ShiftMask, XK_c, killclient, NULL }, \
61 { MODKEY, XK_0, view, NULL }, \ 61 { MODKEY, XK_0, view, NULL }, \
62 { MODKEY, XK_1, view, "0" }, \ 62 { MODKEY, XK_1, view, "0" }, \
diff --git a/config.default.h b/config.default.h
index d629899..ed4447e 100644
--- a/config.default.h
+++ b/config.default.h
@@ -20,7 +20,7 @@ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL };
20 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */ 20 * xprop | awk -F '"' '/^WM_CLASS/ { printf("%s:%s:",$4,$2) }; /^WM_NAME/ { printf("%s\n",$2) }' */
21#define RULES \ 21#define RULES \
22static Rule rule[] = { \ 22static Rule rule[] = { \
23 /* class:instance:title regex tags regex isversatile */ \ 23 /* class:instance:title regex tags regex isuntiled */ \
24 { "Gimp", NULL, True }, \ 24 { "Gimp", NULL, True }, \
25 { "MPlayer", NULL, True }, \ 25 { "MPlayer", NULL, True }, \
26 { "Acroread", NULL, True }, \ 26 { "Acroread", NULL, True }, \
@@ -31,11 +31,11 @@ static Rule rule[] = { \
31static Layout layout[] = { \ 31static Layout layout[] = { \
32 /* symbol function */ \ 32 /* symbol function */ \
33 { "[]=", tile }, /* first entry is default */ \ 33 { "[]=", tile }, /* first entry is default */ \
34 { "><>", versatile }, \ 34 { "><>", untile }, \
35}; 35};
36#define MASTERWIDTH 600 /* master width per thousand */ 36#define MASTERWIDTH 600 /* master width per thousand */
37#define NMASTER 1 /* clients in master area */ 37#define NMASTER 1 /* clients in master area */
38#define SNAP 20 /* versatile snap pixel */ 38#define SNAP 20 /* untiled snap pixel */
39 39
40/* key definitions */ 40/* key definitions */
41#define MODKEY Mod1Mask 41#define MODKEY Mod1Mask
@@ -52,7 +52,7 @@ static Key key[] = { \
52 { MODKEY|ShiftMask, XK_Tab, focusclient, "-1" }, \ 52 { MODKEY|ShiftMask, XK_Tab, focusclient, "-1" }, \
53 { MODKEY, XK_m, togglemax, NULL }, \ 53 { MODKEY, XK_m, togglemax, NULL }, \
54 { MODKEY, XK_Return, zoom, NULL }, \ 54 { MODKEY, XK_Return, zoom, NULL }, \
55 { MODKEY|ShiftMask, XK_space, toggleversatile,NULL }, \ 55 { MODKEY|ShiftMask, XK_space, toggletiled, NULL }, \
56 { MODKEY|ShiftMask, XK_c, killclient, NULL }, \ 56 { MODKEY|ShiftMask, XK_c, killclient, NULL }, \
57 { MODKEY, XK_0, view, NULL }, \ 57 { MODKEY, XK_0, view, NULL }, \
58 { MODKEY, XK_1, view, "0" }, \ 58 { MODKEY, XK_1, view, "0" }, \
diff --git a/draw.c b/draw.c
index 8c9b8e8..58f3998 100644
--- a/draw.c
+++ b/draw.c
@@ -81,7 +81,7 @@ drawstatus(void) {
81 dc.x = x; 81 dc.x = x;
82 if(sel) { 82 if(sel) {
83 drawtext(sel->name, dc.sel); 83 drawtext(sel->name, dc.sel);
84 drawsquare(sel->ismax, sel->isversatile, dc.sel); 84 drawsquare(sel->ismax, sel->isuntiled, dc.sel);
85 } 85 }
86 else 86 else
87 drawtext(NULL, dc.norm); 87 drawtext(NULL, dc.norm);
diff --git a/dwm.1 b/dwm.1
index c688945..5112422 100644
--- a/dwm.1
+++ b/dwm.1
@@ -5,14 +5,14 @@ dwm \- dynamic window manager
5.B dwm 5.B dwm
6.RB [ \-v ] 6.RB [ \-v ]
7.SH DESCRIPTION 7.SH DESCRIPTION
8dwm is a dynamic window manager for X. It manages windows in tiling and 8dwm is a dynamic window manager for X. It manages windows in tiled and
9versatile layouts. Either layout can be applied dynamically, optimizing the 9untiled layouts. Either layout can be applied dynamically, optimizing the
10environment for the application in use and the task performed. 10environment for the application in use and the task performed.
11.P 11.P
12In tiling layout windows are managed in a master and stacking area. The master 12In tiled layout windows are managed in a master and stacking area. The master
13area contains the windows which currently need most attention, whereas the 13area contains the windows which currently need most attention, whereas the
14stacking area contains all other windows. In versatile layout windows can be 14stacking area contains all other windows. In untiled layout windows can be
15resized and moved freely. Dialog windows are always managed versatile, 15resized and moved freely. Dialog windows are always managed untiled,
16regardless of the layout applied. 16regardless of the layout applied.
17.P 17.P
18Windows are grouped by tags. Each window can be tagged with one or multiple 18Windows are grouped by tags. Each window can be tagged with one or multiple
@@ -20,8 +20,8 @@ tags. Selecting certain tags displays all windows with these tags.
20.P 20.P
21dwm contains a small status bar which displays all available tags, the layout, 21dwm contains a small status bar which displays all available tags, the layout,
22the title of the focused window, and the text read from standard input. A 22the title of the focused window, and the text read from standard input. A
23versatile window is indicated with an empty square and a maximized 23untiled window is indicated with an empty square and a maximized
24versatile window is indicated with a filled square before the windows 24untiled window is indicated with a filled square before the windows
25title. The selected tags are indicated with a different color. The tags of 25title. The selected tags are indicated with a different color. The tags of
26the focused window are indicated with a filled square in the top left 26the focused window are indicated with a filled square in the top left
27corner. The tags which are applied to one or more windows are indicated 27corner. The tags which are applied to one or more windows are indicated
@@ -40,7 +40,7 @@ is read and displayed in the status text area.
40.TP 40.TP
41.B Button1 41.B Button1
42click on a tag label to display all windows with that tag, click on the layout 42click on a tag label to display all windows with that tag, click on the layout
43label toggles between tiling and versatile layout. 43label toggles between tiled and untiled layout.
44.TP 44.TP
45.B Button3 45.B Button3
46click on a tag label adds/removes all windows with that tag to/from the view. 46click on a tag label adds/removes all windows with that tag to/from the view.
@@ -57,7 +57,7 @@ Start
57.BR xterm (1). 57.BR xterm (1).
58.TP 58.TP
59.B Mod1-Return 59.B Mod1-Return
60Zooms/cycles current window to/from master area (tiling layout only). 60Zooms/cycles current window to/from master area (tiled layout only).
61.TP 61.TP
62.B Mod1-Tab 62.B Mod1-Tab
63Focus next window. 63Focus next window.
@@ -66,19 +66,19 @@ Focus next window.
66Focus previous window. 66Focus previous window.
67.TP 67.TP
68.B Mod1-g 68.B Mod1-g
69Increase master area width (tiling layout only). 69Increase master area width (tiled layout only).
70.TP 70.TP
71.B Mod1-s 71.B Mod1-s
72Decrease master area width (tiling layout only). 72Decrease master area width (tiled layout only).
73.TP 73.TP
74.B Mod1-i 74.B Mod1-i
75Increase the number of windows in the master area (tiling layout only). 75Increase the number of windows in the master area (tiled layout only).
76.TP 76.TP
77.B Mod1-d 77.B Mod1-d
78Decrease the number of windows in the master area (tiling layout only). 78Decrease the number of windows in the master area (tiled layout only).
79.TP 79.TP
80.B Mod1-m 80.B Mod1-m
81Toggles maximization of current window (versatile layout only). 81Toggles maximization of current window (untiled layout only).
82.TP 82.TP
83.B Mod1-Shift-[1..n] 83.B Mod1-Shift-[1..n]
84Apply 84Apply
@@ -97,10 +97,10 @@ tag to/from current window.
97Close focused window. 97Close focused window.
98.TP 98.TP
99.B Mod1-space 99.B Mod1-space
100Toggle between tiling and versatile layout (affects all windows). 100Toggle between tiled and untiled layout (affects all windows).
101.TP 101.TP
102.B Mod1-Shift-space 102.B Mod1-Shift-space
103Toggle focused window between versatile and non-versatile state (tiling layout only). 103Toggle focused window between untiled and non-untiled state (tiled layout only).
104.TP 104.TP
105.B Mod1-[1..n] 105.B Mod1-[1..n]
106View all windows with 106View all windows with
@@ -120,13 +120,13 @@ Quit dwm.
120.SS Mouse commands 120.SS Mouse commands
121.TP 121.TP
122.B Mod1-Button1 122.B Mod1-Button1
123Move current window while dragging (versatile layout only). 123Move current window while dragging (untiled layout only).
124.TP 124.TP
125.B Mod1-Button2 125.B Mod1-Button2
126Zooms/cycles current window to/from master area (tiling layout only). 126Zooms/cycles current window to/from master area (tiled layout only).
127.TP 127.TP
128.B Mod1-Button3 128.B Mod1-Button3
129Resize current window while dragging (versatile layout only). 129Resize current window while dragging (untiled layout only).
130.SH CUSTOMIZATION 130.SH CUSTOMIZATION
131dwm is customized by creating a custom config.h and (re)compiling the source 131dwm is customized by creating a custom config.h and (re)compiling the source
132code. This keeps it fast, secure and simple. 132code. This keeps it fast, secure and simple.
diff --git a/dwm.h b/dwm.h
index 538018a..a556b73 100644
--- a/dwm.h
+++ b/dwm.h
@@ -67,7 +67,7 @@ struct Client {
67 int minax, minay, maxax, maxay; 67 int minax, minay, maxax, maxay;
68 long flags; 68 long flags;
69 unsigned int border; 69 unsigned int border;
70 Bool isbanned, isfixed, ismax, isversatile; 70 Bool isbanned, isfixed, ismax, isuntiled;
71 Bool *tags; 71 Bool *tags;
72 Client *next; 72 Client *next;
73 Client *prev; 73 Client *prev;
@@ -105,7 +105,7 @@ extern void killclient(const char *arg); /* kill c nicely */
105extern void manage(Window w, XWindowAttributes *wa); /* manage new client */ 105extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
106extern void resize(Client *c, int x, int y, 106extern void resize(Client *c, int x, int y,
107 int w, int h, Bool sizehints); /* resize with given coordinates c*/ 107 int w, int h, Bool sizehints); /* resize with given coordinates c*/
108extern void toggleversatile(const char *arg); /* toggles focused client between versatile/and non-versatile state */ 108extern void toggletiled(const char *arg); /* toggles focused client between tiled/untiled state */
109extern void updatesizehints(Client *c); /* update the size hint variables of c */ 109extern void updatesizehints(Client *c); /* update the size hint variables of c */
110extern void updatetitle(Client *c); /* update the name of c */ 110extern void updatetitle(Client *c); /* update the name of c */
111extern void unmanage(Client *c); /* destroy c */ 111extern void unmanage(Client *c); /* destroy c */
@@ -126,8 +126,8 @@ extern void initlayouts(void); /* initialize layout array */
126extern Client *nexttiled(Client *c); /* returns tiled successor of c */ 126extern Client *nexttiled(Client *c); /* returns tiled successor of c */
127extern void restack(void); /* restores z layers of all clients */ 127extern void restack(void); /* restores z layers of all clients */
128extern void setlayout(const char *arg); /* sets layout, -1 toggles */ 128extern void setlayout(const char *arg); /* sets layout, -1 toggles */
129extern void togglemax(const char *arg); /* toggles maximization of versatile client */ 129extern void togglemax(const char *arg); /* toggles maximization of untiled client */
130extern void versatile(void); /* arranges all windows versatile */ 130extern void untile(void); /* arranges all windows untiled */
131extern void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */ 131extern void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */
132 132
133/* main.c */ 133/* main.c */
diff --git a/event.c b/event.c
index acf1b01..a442d2e 100644
--- a/event.c
+++ b/event.c
@@ -151,14 +151,14 @@ buttonpress(XEvent *e) {
151 focus(c); 151 focus(c);
152 if(CLEANMASK(ev->state) != MODKEY) 152 if(CLEANMASK(ev->state) != MODKEY)
153 return; 153 return;
154 if(ev->button == Button1 && (lt->arrange == versatile || c->isversatile)) { 154 if(ev->button == Button1 && (lt->arrange == untile || c->isuntiled)) {
155 restack(); 155 restack();
156 movemouse(c); 156 movemouse(c);
157 } 157 }
158 else if(ev->button == Button2) 158 else if(ev->button == Button2)
159 zoom(NULL); 159 zoom(NULL);
160 else if(ev->button == Button3 160 else if(ev->button == Button3
161 && (lt->arrange == versatile || c->isversatile) && !c->isfixed) 161 && (lt->arrange == untile || c->isuntiled) && !c->isfixed)
162 { 162 {
163 restack(); 163 restack();
164 resizemouse(c); 164 resizemouse(c);
@@ -176,7 +176,7 @@ configurerequest(XEvent *e) {
176 c->ismax = False; 176 c->ismax = False;
177 if(ev->value_mask & CWBorderWidth) 177 if(ev->value_mask & CWBorderWidth)
178 c->border = ev->border_width; 178 c->border = ev->border_width;
179 if(c->isfixed || c->isversatile || (lt->arrange == versatile)) { 179 if(c->isfixed || c->isuntiled || (lt->arrange == untile)) {
180 if(ev->value_mask & CWX) 180 if(ev->value_mask & CWX)
181 c->x = ev->x; 181 c->x = ev->x;
182 if(ev->value_mask & CWY) 182 if(ev->value_mask & CWY)
@@ -304,7 +304,7 @@ propertynotify(XEvent *e) {
304 default: break; 304 default: break;
305 case XA_WM_TRANSIENT_FOR: 305 case XA_WM_TRANSIENT_FOR:
306 XGetTransientForHint(dpy, c->win, &trans); 306 XGetTransientForHint(dpy, c->win, &trans);
307 if(!c->isversatile && (c->isversatile = (getclient(trans) != NULL))) 307 if(!c->isuntiled && (c->isuntiled = (getclient(trans) != NULL)))
308 lt->arrange(); 308 lt->arrange();
309 break; 309 break;
310 case XA_WM_NORMAL_HINTS: 310 case XA_WM_NORMAL_HINTS:
diff --git a/layout.c b/layout.c
index 1e8f113..bb477d6 100644
--- a/layout.c
+++ b/layout.c
@@ -31,7 +31,7 @@ tile(void) {
31 if(c->isbanned) 31 if(c->isbanned)
32 XMoveWindow(dpy, c->win, c->x, c->y); 32 XMoveWindow(dpy, c->win, c->x, c->y);
33 c->isbanned = False; 33 c->isbanned = False;
34 if(c->isversatile) 34 if(c->isuntiled)
35 continue; 35 continue;
36 c->ismax = False; 36 c->ismax = False;
37 nx = wax; 37 nx = wax;
@@ -148,7 +148,7 @@ initlayouts(void) {
148 148
149Client * 149Client *
150nexttiled(Client *c) { 150nexttiled(Client *c) {
151 for(; c && (c->isversatile || !isvisible(c)); c = c->next); 151 for(; c && (c->isuntiled || !isvisible(c)); c = c->next);
152 return c; 152 return c;
153} 153}
154 154
@@ -160,10 +160,10 @@ restack(void) {
160 drawstatus(); 160 drawstatus();
161 if(!sel) 161 if(!sel)
162 return; 162 return;
163 if(sel->isversatile || lt->arrange == versatile) 163 if(sel->isuntiled || lt->arrange == untile)
164 XRaiseWindow(dpy, sel->win); 164 XRaiseWindow(dpy, sel->win);
165 if(lt->arrange != versatile) { 165 if(lt->arrange != untile) {
166 if(!sel->isversatile) 166 if(!sel->isuntiled)
167 XLowerWindow(dpy, sel->win); 167 XLowerWindow(dpy, sel->win);
168 for(c = nexttiled(clients); c; c = nexttiled(c->next)) { 168 for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
169 if(c == sel) 169 if(c == sel)
@@ -202,7 +202,7 @@ void
202togglemax(const char *arg) { 202togglemax(const char *arg) {
203 XEvent ev; 203 XEvent ev;
204 204
205 if(!sel || (lt->arrange != versatile && !sel->isversatile) || sel->isfixed) 205 if(!sel || (lt->arrange != untile && !sel->isuntiled) || sel->isfixed)
206 return; 206 return;
207 if((sel->ismax = !sel->ismax)) { 207 if((sel->ismax = !sel->ismax)) {
208 sel->rx = sel->x; 208 sel->rx = sel->x;
@@ -218,7 +218,7 @@ togglemax(const char *arg) {
218} 218}
219 219
220void 220void
221versatile(void) { 221untile(void) {
222 Client *c; 222 Client *c;
223 223
224 for(c = clients; c; c = c->next) { 224 for(c = clients; c; c = c->next) {
@@ -245,7 +245,7 @@ zoom(const char *arg) {
245 unsigned int n; 245 unsigned int n;
246 Client *c; 246 Client *c;
247 247
248 if(!sel || lt->arrange != tile || sel->isversatile) 248 if(!sel || lt->arrange != tile || sel->isuntiled)
249 return; 249 return;
250 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) 250 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
251 n++; 251 n++;
diff --git a/tag.c b/tag.c
index 8f41d82..b8539ac 100644
--- a/tag.c
+++ b/tag.c
@@ -12,7 +12,7 @@
12typedef struct { 12typedef struct {
13 const char *prop; 13 const char *prop;
14 const char *tags; 14 const char *tags;
15 Bool isversatile; 15 Bool isuntiled;
16} Rule; 16} Rule;
17 17
18typedef struct { 18typedef struct {
@@ -83,7 +83,7 @@ settags(Client *c, Client *trans) {
83 ch.res_name ? ch.res_name : "", c->name); 83 ch.res_name ? ch.res_name : "", c->name);
84 for(i = 0; i < nrules; i++) 84 for(i = 0; i < nrules; i++)
85 if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) { 85 if(regs[i].propregex && !regexec(regs[i].propregex, prop, 1, &tmp, 0)) {
86 c->isversatile = rule[i].isversatile; 86 c->isuntiled = rule[i].isuntiled;
87 for(j = 0; regs[i].tagregex && j < ntags; j++) { 87 for(j = 0; regs[i].tagregex && j < ntags; j++) {
88 if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) { 88 if(!regexec(regs[i].tagregex, tags[j], 1, &tmp, 0)) {
89 matched = True; 89 matched = True;