sites

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

nextprevtag.c (342B)


      1 void
      2 view_adjacent(const Arg *arg)
      3 {
      4 	int i, curtags;
      5 	int seltag = 0;
      6 	Arg a;
      7 
      8 	curtags = selmon->tagset[selmon->seltags];
      9 	for(i = 0; i < LENGTH(tags); i++)
     10 		if(curtags & (1 << i)){
     11 			seltag = i;
     12 			break;
     13 		}
     14 
     15 	seltag = (seltag + arg->i) % (int)LENGTH(tags);
     16 	if(seltag < 0)
     17 		seltag += LENGTH(tags);
     18 
     19 	a.i = (1 << seltag);
     20 	view(&a);
     21 }