aewl

changeset 46:58307ad56ec1

added xlock command (I need it regularly)
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 12:19:10 +0200
parents 7943c72e34eb
children 2a251be59a6b
files client.c dev.c dwm.h dwm.html
diffstat 4 files changed, 19 insertions(+), 25 deletions(-) [+]
line diff
     1.1 --- a/client.c	Thu Jul 13 12:00:20 2006 +0200
     1.2 +++ b/client.c	Thu Jul 13 12:19:10 2006 +0200
     1.3 @@ -11,9 +11,7 @@
     1.4  
     1.5  #include "dwm.h"
     1.6  
     1.7 -static void floating(void);
     1.8 -static void tiling(void);
     1.9 -static void (*arrange)(void) = floating;
    1.10 +static void (*arrange)(void *) = floating;
    1.11  
    1.12  void
    1.13  max(void *aux)
    1.14 @@ -24,27 +22,30 @@
    1.15  	stack->y = sy;
    1.16  	stack->w = sw - 2 * stack->border;
    1.17  	stack->h = sh - 2 * stack->border;
    1.18 +	craise(stack);
    1.19  	resize(stack);
    1.20  	discard_events(EnterWindowMask);
    1.21  }
    1.22  
    1.23 -static void
    1.24 -floating(void)
    1.25 +void
    1.26 +floating(void *aux)
    1.27  {
    1.28  	Client *c;
    1.29  
    1.30 +	arrange = floating;
    1.31  	for(c = stack; c; c = c->snext)
    1.32  		resize(c);
    1.33  	discard_events(EnterWindowMask);
    1.34  }
    1.35  
    1.36 -static void
    1.37 -tiling(void)
    1.38 +void
    1.39 +tiling(void *aux)
    1.40  {
    1.41  	Client *c;
    1.42  	int n, cols, rows, gw, gh, i, j;
    1.43      float rt, fd;
    1.44  
    1.45 +	arrange = tiling;
    1.46  	if(!clients)
    1.47  		return;
    1.48  	for(n = 0, c = clients; c; c = c->next, n++);
    1.49 @@ -76,17 +77,6 @@
    1.50  }
    1.51  
    1.52  void
    1.53 -toggle(void *aux)
    1.54 -{
    1.55 -	if(arrange == floating)
    1.56 -		arrange = tiling;
    1.57 -	else
    1.58 -		arrange = floating;
    1.59 -	arrange();
    1.60 -}
    1.61 -
    1.62 -
    1.63 -void
    1.64  sel(void *aux)
    1.65  {
    1.66  	const char *arg = aux;
    1.67 @@ -280,7 +270,7 @@
    1.68  			GrabModeAsync, GrabModeSync, None, None);
    1.69  	XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask,
    1.70  			GrabModeAsync, GrabModeSync, None, None);
    1.71 -	arrange();
    1.72 +	arrange(NULL);
    1.73  	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
    1.74  	focus(c);
    1.75  }
    1.76 @@ -400,7 +390,7 @@
    1.77  	XFlush(dpy);
    1.78  	XSetErrorHandler(error_handler);
    1.79  	XUngrabServer(dpy);
    1.80 -	arrange();
    1.81 +	arrange(NULL);
    1.82  	if(stack)
    1.83  		focus(stack);
    1.84  }
     2.1 --- a/dev.c	Thu Jul 13 12:00:20 2006 +0200
     2.2 +++ b/dev.c	Thu Jul 13 12:19:10 2006 +0200
     2.3 @@ -17,13 +17,16 @@
     2.4  	"-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL
     2.5  };
     2.6  const char *browse[] = { "firefox", NULL };
     2.7 +const char *xlock[] = { "xlock", NULL };
     2.8  
     2.9  static Key key[] = {
    2.10  	{ Mod1Mask, XK_Return, (void (*)(void *))spawn, term },
    2.11  	{ Mod1Mask, XK_w, (void (*)(void *))spawn, browse },
    2.12 +	{ Mod1Mask, XK_l, (void (*)(void *))spawn, xlock },
    2.13  	{ Mod1Mask, XK_k, sel, "prev" }, 
    2.14  	{ Mod1Mask, XK_j, sel, "next" }, 
    2.15 -	{ Mod1Mask, XK_space, toggle, NULL }, 
    2.16 +	{ Mod1Mask, XK_t, tiling, NULL }, 
    2.17 +	{ Mod1Mask, XK_f, tiling, NULL }, 
    2.18  	{ Mod1Mask, XK_m, max, NULL }, 
    2.19  	{ Mod1Mask | ShiftMask, XK_c, ckill, NULL }, 
    2.20  	{ Mod1Mask | ShiftMask, XK_q, quit, NULL },
     3.1 --- a/dwm.h	Thu Jul 13 12:00:20 2006 +0200
     3.2 +++ b/dwm.h	Thu Jul 13 12:19:10 2006 +0200
     3.3 @@ -100,7 +100,8 @@
     3.4  extern void ckill(void *aux);
     3.5  extern void sel(void *aux);
     3.6  extern void max(void *aux);
     3.7 -extern void toggle(void *aux);
     3.8 +extern void floating(void *aux);
     3.9 +extern void tiling(void *aux);
    3.10  extern void gravitate(Client *c, Bool invert);
    3.11  
    3.12  /* draw.c */
     4.1 --- a/dwm.html	Thu Jul 13 12:00:20 2006 +0200
     4.2 +++ b/dwm.html	Thu Jul 13 12:19:10 2006 +0200
     4.3 @@ -59,9 +59,9 @@
     4.4  			</li>
     4.5  			<li>
     4.6  			garbeam <b>does not</b> want any feedback to dwm. If you ask for support,
     4.7 -			feature requests or if you report bugs, they will be <b>ignored</b>
     4.8 -			with a high chance. dwm is only intended to fit garbeam's needs,
     4.9 -			however you are free to download and distribute/relicense it, with the
    4.10 +			feature requests, or if you report bugs, they will be <b>ignored</b>
    4.11 +			with a high chance. dwm is only intended to fit garbeams needs.
    4.12 +			However you are free to download and distribute/relicense it, with the
    4.13  			conditions of the <a href="http://wmii.de/cgi-bin/hgwebdir.cgi/dwm?f=f10eb1139362;file=LICENSE;style=raw">MIT/X Consortium license</a>.
    4.14  			</li>
    4.15  		</ul>