add change tabs on win-(shift)-tab
This commit is contained in:
		| @ -26,7 +26,7 @@ static const char *colors[][3]      = { | ||||
| }; | ||||
|  | ||||
| /* tagging */ | ||||
| static const char *tags[] = { "", "", "3", "4", "5", "6", "7", "8", "" }; | ||||
| static const char *tags[] = { "", "", "3", "", "5", "6", "7", "8", "" }; | ||||
|  | ||||
| static const Rule rules[] = { | ||||
| 	/* xprop(1): | ||||
| @ -80,7 +80,9 @@ static Key keys[] = { | ||||
| 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} }, | ||||
| 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} }, | ||||
| 	{ MODKEY|ShiftMask,             XK_Return, zoom,           {0} }, | ||||
| 	{ MODKEY,                       XK_Tab,    view,           {.i = +1} }, | ||||
| 	{ MODKEY,                       XK_Tab,    view,           {.ui =  0 } }, // next tab | ||||
| 	{ MODKEY|ShiftMask,             XK_Tab,    view,           {.ui = -1 } }, // prev tab | ||||
| 	{ MODKEY|ControlMask,           XK_Tab,    view,           {.ui = -2 } }, // last tab | ||||
| 	{ MODKEY,                       XK_q,      killclient,     {0} }, | ||||
| 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} }, | ||||
| 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} }, | ||||
|  | ||||
							
								
								
									
										6
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								config.h
									
									
									
									
									
								
							| @ -26,7 +26,7 @@ static const char *colors[][3]      = { | ||||
| }; | ||||
|  | ||||
| /* tagging */ | ||||
| static const char *tags[] = { "", "", "3", "4", "5", "6", "7", "8", "" }; | ||||
| static const char *tags[] = { "", "", "3", "", "5", "6", "7", "8", "" }; | ||||
|  | ||||
| static const Rule rules[] = { | ||||
| 	/* xprop(1): | ||||
| @ -80,7 +80,9 @@ static Key keys[] = { | ||||
| 	{ MODKEY,                       XK_h,      setmfact,       {.f = -0.05} }, | ||||
| 	{ MODKEY,                       XK_l,      setmfact,       {.f = +0.05} }, | ||||
| 	{ MODKEY|ShiftMask,             XK_Return, zoom,           {0} }, | ||||
| 	{ MODKEY,                       XK_Tab,    view,           {.i = +1} }, | ||||
| 	{ MODKEY,                       XK_Tab,    view,           {.ui =  0 } }, // next tab | ||||
| 	{ MODKEY|ShiftMask,             XK_Tab,    view,           {.ui = -1 } }, // prev tab | ||||
| 	{ MODKEY|ControlMask,           XK_Tab,    view,           {.ui = -2 } }, // last tab | ||||
| 	{ MODKEY,                       XK_q,      killclient,     {0} }, | ||||
| 	{ MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} }, | ||||
| 	{ MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} }, | ||||
|  | ||||
							
								
								
									
										25
									
								
								dwm.c
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								dwm.c
									
									
									
									
									
								
							| @ -2045,9 +2045,30 @@ view(const Arg *arg) | ||||
| { | ||||
| 	if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) | ||||
| 		return; | ||||
| 	selmon->seltags ^= 1; /* toggle sel tagset */ | ||||
| 	if (arg->ui & TAGMASK) | ||||
|  | ||||
|     if (arg->ui != -2) | ||||
|         selmon->tagset[selmon->seltags ^ 1] = selmon->tagset[selmon->seltags]; | ||||
|  | ||||
|     if (arg->ui == 0) { | ||||
|         if (selmon->tagset[selmon->seltags] << 1 > TAGMASK) | ||||
|             selmon->tagset[selmon->seltags] = 1; | ||||
|         else | ||||
|             selmon->tagset[selmon->seltags] <<= 1; | ||||
|     } | ||||
|     else if (arg->ui == -1) { | ||||
|         if (selmon->tagset[selmon->seltags] >> 1 < 1) | ||||
|             selmon->tagset[selmon->seltags] = (TAGMASK + 1) >> 1; | ||||
|         else | ||||
|             selmon->tagset[selmon->seltags] >>= 1; | ||||
|     } | ||||
|     else if (arg->ui == -2) { | ||||
|         selmon->tagset[selmon->seltags] += selmon->tagset[selmon->seltags ^ 1]; | ||||
|         selmon->tagset[selmon->seltags ^ 1] = selmon->tagset[selmon->seltags] - selmon->tagset[selmon->seltags ^ 1]; | ||||
|         selmon->tagset[selmon->seltags] -= selmon->tagset[selmon->seltags ^ 1]; | ||||
|     } | ||||
| 	else if (arg->ui & TAGMASK) | ||||
| 		selmon->tagset[selmon->seltags] = arg->ui & TAGMASK; | ||||
|  | ||||
| 	focus(NULL); | ||||
| 	arrange(selmon); | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Linux User
					Linux User