sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-tagall-6.1.diff (1058B)


      1 Author: Jan Christoph Ebersbach <jceb@e-jc.de>
      2 URL: http://dwm.suckless.org/patches/historical/tagall
      3 Shortcut to move all (floating) windows from one tag to another.
      4 
      5 Index: dwm/tagall.c
      6 ===================================================================
      7 --- /dev/null	1970-01-01 00:00:00.000000000 +0000
      8 +++ dwm/tagall.c	2014-02-09 15:24:11.468116949 +0100
      9 @@ -0,0 +1,24 @@
     10 +void
     11 +tagall(const Arg *arg) {
     12 +	if (!selmon->clients)
     13 +		return;
     14 +	/* if parameter starts with F, just move floating windows */
     15 +	int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0;
     16 +	int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0;
     17 +	int j;
     18 +	Client* c;
     19 +	if(tag >= 0 && tag < LENGTH(tags))
     20 +		for(c = selmon->clients; c; c = c->next)
     21 +		{
     22 +			if(!floating_only || c->isfloating)
     23 +				for(j = 0; j < LENGTH(tags); j++)
     24 +				{
     25 +					if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j)
     26 +					{
     27 +						c->tags = c->tags ^ (1 << j & TAGMASK);
     28 +						c->tags = c->tags | 1 << (tag-1);
     29 +					}
     30 +				}
     31 +		}
     32 +	arrange(selmon);
     33 +}