summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client.c30
-rw-r--r--dev.c5
-rw-r--r--dwm.h3
-rw-r--r--dwm.html6
4 files changed, 19 insertions, 25 deletions
diff --git a/client.c b/client.c
index 5e7321d..d3b731b 100644
--- a/client.c
+++ b/client.c
@@ -11,9 +11,7 @@
11 11
12#include "dwm.h" 12#include "dwm.h"
13 13
14static void floating(void); 14static void (*arrange)(void *) = floating;
15static void tiling(void);
16static void (*arrange)(void) = floating;
17 15
18void 16void
19max(void *aux) 17max(void *aux)
@@ -24,27 +22,30 @@ max(void *aux)
24 stack->y = sy; 22 stack->y = sy;
25 stack->w = sw - 2 * stack->border; 23 stack->w = sw - 2 * stack->border;
26 stack->h = sh - 2 * stack->border; 24 stack->h = sh - 2 * stack->border;
25 craise(stack);
27 resize(stack); 26 resize(stack);
28 discard_events(EnterWindowMask); 27 discard_events(EnterWindowMask);
29} 28}
30 29
31static void 30void
32floating(void) 31floating(void *aux)
33{ 32{
34 Client *c; 33 Client *c;
35 34
35 arrange = floating;
36 for(c = stack; c; c = c->snext) 36 for(c = stack; c; c = c->snext)
37 resize(c); 37 resize(c);
38 discard_events(EnterWindowMask); 38 discard_events(EnterWindowMask);
39} 39}
40 40
41static void 41void
42tiling(void) 42tiling(void *aux)
43{ 43{
44 Client *c; 44 Client *c;
45 int n, cols, rows, gw, gh, i, j; 45 int n, cols, rows, gw, gh, i, j;
46 float rt, fd; 46 float rt, fd;
47 47
48 arrange = tiling;
48 if(!clients) 49 if(!clients)
49 return; 50 return;
50 for(n = 0, c = clients; c; c = c->next, n++); 51 for(n = 0, c = clients; c; c = c->next, n++);
@@ -76,17 +77,6 @@ tiling(void)
76} 77}
77 78
78void 79void
79toggle(void *aux)
80{
81 if(arrange == floating)
82 arrange = tiling;
83 else
84 arrange = floating;
85 arrange();
86}
87
88
89void
90sel(void *aux) 80sel(void *aux)
91{ 81{
92 const char *arg = aux; 82 const char *arg = aux;
@@ -280,7 +270,7 @@ manage(Window w, XWindowAttributes *wa)
280 GrabModeAsync, GrabModeSync, None, None); 270 GrabModeAsync, GrabModeSync, None, None);
281 XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, 271 XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask,
282 GrabModeAsync, GrabModeSync, None, None); 272 GrabModeAsync, GrabModeSync, None, None);
283 arrange(); 273 arrange(NULL);
284 XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); 274 XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
285 focus(c); 275 focus(c);
286} 276}
@@ -400,7 +390,7 @@ unmanage(Client *c)
400 XFlush(dpy); 390 XFlush(dpy);
401 XSetErrorHandler(error_handler); 391 XSetErrorHandler(error_handler);
402 XUngrabServer(dpy); 392 XUngrabServer(dpy);
403 arrange(); 393 arrange(NULL);
404 if(stack) 394 if(stack)
405 focus(stack); 395 focus(stack);
406} 396}
diff --git a/dev.c b/dev.c
index 221715e..b25d9e3 100644
--- a/dev.c
+++ b/dev.c
@@ -17,13 +17,16 @@ const char *term[] = {
17 "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL 17 "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL
18}; 18};
19const char *browse[] = { "firefox", NULL }; 19const char *browse[] = { "firefox", NULL };
20const char *xlock[] = { "xlock", NULL };
20 21
21static Key key[] = { 22static Key key[] = {
22 { Mod1Mask, XK_Return, (void (*)(void *))spawn, term }, 23 { Mod1Mask, XK_Return, (void (*)(void *))spawn, term },
23 { Mod1Mask, XK_w, (void (*)(void *))spawn, browse }, 24 { Mod1Mask, XK_w, (void (*)(void *))spawn, browse },
25 { Mod1Mask, XK_l, (void (*)(void *))spawn, xlock },
24 { Mod1Mask, XK_k, sel, "prev" }, 26 { Mod1Mask, XK_k, sel, "prev" },
25 { Mod1Mask, XK_j, sel, "next" }, 27 { Mod1Mask, XK_j, sel, "next" },
26 { Mod1Mask, XK_space, toggle, NULL }, 28 { Mod1Mask, XK_t, tiling, NULL },
29 { Mod1Mask, XK_f, tiling, NULL },
27 { Mod1Mask, XK_m, max, NULL }, 30 { Mod1Mask, XK_m, max, NULL },
28 { Mod1Mask | ShiftMask, XK_c, ckill, NULL }, 31 { Mod1Mask | ShiftMask, XK_c, ckill, NULL },
29 { Mod1Mask | ShiftMask, XK_q, quit, NULL }, 32 { Mod1Mask | ShiftMask, XK_q, quit, NULL },
diff --git a/dwm.h b/dwm.h
index acfdcbb..1d672fd 100644
--- a/dwm.h
+++ b/dwm.h
@@ -100,7 +100,8 @@ extern void lower(Client *c);
100extern void ckill(void *aux); 100extern void ckill(void *aux);
101extern void sel(void *aux); 101extern void sel(void *aux);
102extern void max(void *aux); 102extern void max(void *aux);
103extern void toggle(void *aux); 103extern void floating(void *aux);
104extern void tiling(void *aux);
104extern void gravitate(Client *c, Bool invert); 105extern void gravitate(Client *c, Bool invert);
105 106
106/* draw.c */ 107/* draw.c */
diff --git a/dwm.html b/dwm.html
index 4b2f663..995c6fd 100644
--- a/dwm.html
+++ b/dwm.html
@@ -59,9 +59,9 @@
59 </li> 59 </li>
60 <li> 60 <li>
61 garbeam <b>does not</b> want any feedback to dwm. If you ask for support, 61 garbeam <b>does not</b> want any feedback to dwm. If you ask for support,
62 feature requests or if you report bugs, they will be <b>ignored</b> 62 feature requests, or if you report bugs, they will be <b>ignored</b>
63 with a high chance. dwm is only intended to fit garbeam's needs, 63 with a high chance. dwm is only intended to fit garbeams needs.
64 however you are free to download and distribute/relicense it, with the 64 However you are free to download and distribute/relicense it, with the
65 conditions of the <a href="http://wmii.de/cgi-bin/hgwebdir.cgi/dwm?f=f10eb1139362;file=LICENSE;style=raw">MIT/X Consortium license</a>. 65 conditions of the <a href="http://wmii.de/cgi-bin/hgwebdir.cgi/dwm?f=f10eb1139362;file=LICENSE;style=raw">MIT/X Consortium license</a>.
66 </li> 66 </li>
67 </ul> 67 </ul>