URI: 
       dwm-tagall-6.0.diff - sites - public wiki contents of suckless.org
  HTML git clone git://git.suckless.org/sites
   DIR Log
   DIR Files
   DIR Refs
       ---
       dwm-tagall-6.0.diff (988B)
       ---
            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 diff -r ec4baab78314 tagall.c
            6 --- /dev/null        Thu Jan 01 00:00:00 1970 +0000
            7 +++ b/tagall.c        Fri Apr 06 08:23:21 2012 +0200
            8 @@ -0,0 +1,24 @@
            9 +void
           10 +tagall(const Arg *arg) {
           11 +        if (!selmon->clients)
           12 +                return;
           13 +        /* if parameter starts with F, just move floating windows */
           14 +        int floating_only = (char *)arg->v && ((char *)arg->v)[0] == 'F' ? 1 : 0;
           15 +        int tag = (char *)arg->v ? atoi(((char *)arg->v) + floating_only) : 0;
           16 +        int j;
           17 +        Client* c;
           18 +        if(tag >= 0 && tag < LENGTH(tags))
           19 +                for(c = selmon->clients; c; c = c->next)
           20 +                {
           21 +                        if(!floating_only || c->isfloating)
           22 +                                for(j = 0; j < LENGTH(tags); j++)
           23 +                                {
           24 +                                        if(c->tags & 1 << j && selmon->tagset[selmon->seltags] & 1 << j)
           25 +                                        {
           26 +                                                c->tags = c->tags ^ (1 << j & TAGMASK);
           27 +                                                c->tags = c->tags | 1 << (tag-1);
           28 +                                        }
           29 +                                }
           30 +                }
           31 +        arrange(selmon);
           32 +}