added xlock command (I need it regularly)
ce846e94
4 file(s) · +19 −25
| 11 | 11 | ||
| 12 | 12 | #include "dwm.h" |
|
| 13 | 13 | ||
| 14 | - | static void floating(void); |
|
| 15 | - | static void tiling(void); |
|
| 16 | - | static void (*arrange)(void) = floating; |
|
| 14 | + | static void (*arrange)(void *) = floating; |
|
| 17 | 15 | ||
| 18 | 16 | void |
|
| 19 | 17 | max(void *aux) |
|
| 24 | 22 | stack->y = sy; |
|
| 25 | 23 | stack->w = sw - 2 * stack->border; |
|
| 26 | 24 | stack->h = sh - 2 * stack->border; |
|
| 25 | + | craise(stack); |
|
| 27 | 26 | resize(stack); |
|
| 28 | 27 | discard_events(EnterWindowMask); |
|
| 29 | 28 | } |
|
| 30 | 29 | ||
| 31 | - | static void |
|
| 32 | - | floating(void) |
|
| 30 | + | void |
|
| 31 | + | floating(void *aux) |
|
| 33 | 32 | { |
|
| 34 | 33 | Client *c; |
|
| 35 | 34 | ||
| 35 | + | arrange = floating; |
|
| 36 | 36 | for(c = stack; c; c = c->snext) |
|
| 37 | 37 | resize(c); |
|
| 38 | 38 | discard_events(EnterWindowMask); |
|
| 39 | 39 | } |
|
| 40 | 40 | ||
| 41 | - | static void |
|
| 42 | - | tiling(void) |
|
| 41 | + | void |
|
| 42 | + | tiling(void *aux) |
|
| 43 | 43 | { |
|
| 44 | 44 | Client *c; |
|
| 45 | 45 | int n, cols, rows, gw, gh, i, j; |
|
| 46 | 46 | float rt, fd; |
|
| 47 | 47 | ||
| 48 | + | arrange = tiling; |
|
| 48 | 49 | if(!clients) |
|
| 49 | 50 | return; |
|
| 50 | 51 | for(n = 0, c = clients; c; c = c->next, n++); |
|
| 74 | 75 | } |
|
| 75 | 76 | discard_events(EnterWindowMask); |
|
| 76 | 77 | } |
|
| 77 | - | ||
| 78 | - | void |
|
| 79 | - | toggle(void *aux) |
|
| 80 | - | { |
|
| 81 | - | if(arrange == floating) |
|
| 82 | - | arrange = tiling; |
|
| 83 | - | else |
|
| 84 | - | arrange = floating; |
|
| 85 | - | arrange(); |
|
| 86 | - | } |
|
| 87 | - | ||
| 88 | 78 | ||
| 89 | 79 | void |
|
| 90 | 80 | sel(void *aux) |
|
| 280 | 270 | GrabModeAsync, GrabModeSync, None, None); |
|
| 281 | 271 | XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, |
|
| 282 | 272 | GrabModeAsync, GrabModeSync, None, None); |
|
| 283 | - | arrange(); |
|
| 273 | + | arrange(NULL); |
|
| 284 | 274 | XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); |
|
| 285 | 275 | focus(c); |
|
| 286 | 276 | } |
|
| 400 | 390 | XFlush(dpy); |
|
| 401 | 391 | XSetErrorHandler(error_handler); |
|
| 402 | 392 | XUngrabServer(dpy); |
|
| 403 | - | arrange(); |
|
| 393 | + | arrange(NULL); |
|
| 404 | 394 | if(stack) |
|
| 405 | 395 | focus(stack); |
|
| 406 | 396 | } |
|
| 17 | 17 | "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL |
|
| 18 | 18 | }; |
|
| 19 | 19 | const char *browse[] = { "firefox", NULL }; |
|
| 20 | + | const char *xlock[] = { "xlock", NULL }; |
|
| 20 | 21 | ||
| 21 | 22 | static Key key[] = { |
|
| 22 | 23 | { Mod1Mask, XK_Return, (void (*)(void *))spawn, term }, |
|
| 23 | 24 | { Mod1Mask, XK_w, (void (*)(void *))spawn, browse }, |
|
| 25 | + | { Mod1Mask, XK_l, (void (*)(void *))spawn, xlock }, |
|
| 24 | 26 | { Mod1Mask, XK_k, sel, "prev" }, |
|
| 25 | 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 | 30 | { Mod1Mask, XK_m, max, NULL }, |
|
| 28 | 31 | { Mod1Mask | ShiftMask, XK_c, ckill, NULL }, |
|
| 29 | 32 | { Mod1Mask | ShiftMask, XK_q, quit, NULL }, |
| 100 | 100 | extern void ckill(void *aux); |
|
| 101 | 101 | extern void sel(void *aux); |
|
| 102 | 102 | extern void max(void *aux); |
|
| 103 | - | extern void toggle(void *aux); |
|
| 103 | + | extern void floating(void *aux); |
|
| 104 | + | extern void tiling(void *aux); |
|
| 104 | 105 | extern void gravitate(Client *c, Bool invert); |
|
| 105 | 106 | ||
| 106 | 107 | /* draw.c */ |
| 59 | 59 | </li> |
|
| 60 | 60 | <li> |
|
| 61 | 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> |
|
| 63 | - | with a high chance. dwm is only intended to fit garbeam's needs, |
|
| 64 | - | however you are free to download and distribute/relicense it, with the |
|
| 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 garbeams needs. |
|
| 64 | + | However you are free to download and distribute/relicense it, with the |
|
| 65 | 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 | 66 | </li> |
|
| 67 | 67 | </ul> |