# HG changeset patch # User Anselm R. Garbe # Date 1152785950 -7200 # Node ID 58307ad56ec1ce3dd5e848d4df434ccbdfe39eb0 # Parent 7943c72e34ebfbde1c70bdef8f595c30b3d9b921 added xlock command (I need it regularly) diff -r 7943c72e34eb -r 58307ad56ec1 client.c --- a/client.c Thu Jul 13 12:00:20 2006 +0200 +++ b/client.c Thu Jul 13 12:19:10 2006 +0200 @@ -11,9 +11,7 @@ #include "dwm.h" -static void floating(void); -static void tiling(void); -static void (*arrange)(void) = floating; +static void (*arrange)(void *) = floating; void max(void *aux) @@ -24,27 +22,30 @@ stack->y = sy; stack->w = sw - 2 * stack->border; stack->h = sh - 2 * stack->border; + craise(stack); resize(stack); discard_events(EnterWindowMask); } -static void -floating(void) +void +floating(void *aux) { Client *c; + arrange = floating; for(c = stack; c; c = c->snext) resize(c); discard_events(EnterWindowMask); } -static void -tiling(void) +void +tiling(void *aux) { Client *c; int n, cols, rows, gw, gh, i, j; float rt, fd; + arrange = tiling; if(!clients) return; for(n = 0, c = clients; c; c = c->next, n++); @@ -76,17 +77,6 @@ } void -toggle(void *aux) -{ - if(arrange == floating) - arrange = tiling; - else - arrange = floating; - arrange(); -} - - -void sel(void *aux) { const char *arg = aux; @@ -280,7 +270,7 @@ GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, GrabModeAsync, GrabModeSync, None, None); - arrange(); + arrange(NULL); XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); focus(c); } @@ -400,7 +390,7 @@ XFlush(dpy); XSetErrorHandler(error_handler); XUngrabServer(dpy); - arrange(); + arrange(NULL); if(stack) focus(stack); } diff -r 7943c72e34eb -r 58307ad56ec1 dev.c --- a/dev.c Thu Jul 13 12:00:20 2006 +0200 +++ b/dev.c Thu Jul 13 12:19:10 2006 +0200 @@ -17,13 +17,16 @@ "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL }; const char *browse[] = { "firefox", NULL }; +const char *xlock[] = { "xlock", NULL }; static Key key[] = { { Mod1Mask, XK_Return, (void (*)(void *))spawn, term }, { Mod1Mask, XK_w, (void (*)(void *))spawn, browse }, + { Mod1Mask, XK_l, (void (*)(void *))spawn, xlock }, { Mod1Mask, XK_k, sel, "prev" }, { Mod1Mask, XK_j, sel, "next" }, - { Mod1Mask, XK_space, toggle, NULL }, + { Mod1Mask, XK_t, tiling, NULL }, + { Mod1Mask, XK_f, tiling, NULL }, { Mod1Mask, XK_m, max, NULL }, { Mod1Mask | ShiftMask, XK_c, ckill, NULL }, { Mod1Mask | ShiftMask, XK_q, quit, NULL }, diff -r 7943c72e34eb -r 58307ad56ec1 dwm.h --- a/dwm.h Thu Jul 13 12:00:20 2006 +0200 +++ b/dwm.h Thu Jul 13 12:19:10 2006 +0200 @@ -100,7 +100,8 @@ extern void ckill(void *aux); extern void sel(void *aux); extern void max(void *aux); -extern void toggle(void *aux); +extern void floating(void *aux); +extern void tiling(void *aux); extern void gravitate(Client *c, Bool invert); /* draw.c */ diff -r 7943c72e34eb -r 58307ad56ec1 dwm.html --- a/dwm.html Thu Jul 13 12:00:20 2006 +0200 +++ b/dwm.html Thu Jul 13 12:19:10 2006 +0200 @@ -59,9 +59,9 @@
  • garbeam does not want any feedback to dwm. If you ask for support, - feature requests or if you report bugs, they will be ignored - with a high chance. dwm is only intended to fit garbeam's needs, - however you are free to download and distribute/relicense it, with the + feature requests, or if you report bugs, they will be ignored + with a high chance. dwm is only intended to fit garbeams needs. + However you are free to download and distribute/relicense it, with the conditions of the MIT/X Consortium license.