changeset 8:e749c30135e9

add tag_n_view()
author paulo@thepaulopc
date Tue, 14 Jun 2011 00:33:07 -0700
parents 162accc5d36d
children bc03b37b37ba
files config.h dwm.h tag.c
diffstat 3 files changed, 17 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/config.h	Tue Jun 14 00:03:39 2011 -0700
     1.2 +++ b/config.h	Tue Jun 14 00:33:07 2011 -0700
     1.3 @@ -152,4 +152,14 @@
     1.4  	{ {0, ShiftMask, 0, 0},		{XK_8, XK_t, 0, 0},		toggletag,		{ .i = 7 } }, \
     1.5  	{ {0, ShiftMask, 0, 0},		{XK_9, XK_t, 0, 0},		toggletag,		{ .i = 8 } }, \
     1.6  	{ {0, ShiftMask, 0, 0},		{XK_0, XK_t, 0, 0},		toggletag,		{ .i = 9 } }, \
     1.7 +	{ {0, 0, 0, 0},		{XK_1, XK_s, 0, 0},		tag_n_view,		{ .i = 0 } }, \
     1.8 +	{ {0, 0, 0, 0},		{XK_2, XK_s, 0, 0},		tag_n_view,		{ .i = 1 } }, \
     1.9 +	{ {0, 0, 0, 0},		{XK_3, XK_s, 0, 0},		tag_n_view,		{ .i = 2 } }, \
    1.10 +	{ {0, 0, 0, 0},		{XK_4, XK_s, 0, 0},		tag_n_view,		{ .i = 3 } }, \
    1.11 +	{ {0, 0, 0, 0},		{XK_5, XK_s, 0, 0},		tag_n_view,		{ .i = 4 } }, \
    1.12 +	{ {0, 0, 0, 0},		{XK_6, XK_s, 0, 0},		tag_n_view,		{ .i = 5 } }, \
    1.13 +	{ {0, 0, 0, 0},		{XK_7, XK_s, 0, 0},		tag_n_view,		{ .i = 6 } }, \
    1.14 +	{ {0, 0, 0, 0},		{XK_8, XK_s, 0, 0},		tag_n_view,		{ .i = 7 } }, \
    1.15 +	{ {0, 0, 0, 0},		{XK_9, XK_s, 0, 0},		tag_n_view,		{ .i = 8 } }, \
    1.16 +	{ {0, 0, 0, 0},		{XK_0, XK_s, 0, 0},		tag_n_view,		{ .i = 9 } }, \
    1.17  };
     2.1 --- a/dwm.h	Tue Jun 14 00:03:39 2011 -0700
     2.2 +++ b/dwm.h	Tue Jun 14 00:33:07 2011 -0700
     2.3 @@ -161,6 +161,7 @@
     2.4  extern void view(Arg *arg);			/* views the tag with arg's index */
     2.5  extern void last_view(Arg *arg);			/* go to last viewed tag */
     2.6  extern void next_view(Arg *arg);			/* go to next/prev tag */
     2.7 +extern void tag_n_view(Arg *arg);			/* tag then view */
     2.8  
     2.9  /* util.c */
    2.10  extern void *emallocz(unsigned int size);	/* allocates zero-initialized memory, exits on error */
     3.1 --- a/tag.c	Tue Jun 14 00:03:39 2011 -0700
     3.2 +++ b/tag.c	Tue Jun 14 00:33:07 2011 -0700
     3.3 @@ -182,3 +182,9 @@
     3.4  	}
     3.5  	lt->arrange();
     3.6  }
     3.7 +
     3.8 +void
     3.9 +tag_n_view(Arg *arg) {
    3.10 +	tag(arg);
    3.11 +	view(arg);
    3.12 +}