Re: [dwm] cycling through tags?

From: Andrew Oakley <andrew_AT_ado.is-a-geek.net>
Date: Thu, 31 Jan 2008 22:02:18 +0000

There is some question of what it would mean to move to the next tag
when there are multiple tags selected. However, for a given definition
of "next tag" it shouldn't be too hard to code.

I don't think code like this should really be included in dwm - the
question of what "next tag" means really is debatable, and people can
easily hack it if they want.

At the top of dwm.c, with the other declarations:
void nexttag(const char *arg);

Somewhere further down (doesn't really matter where) in dwm.c:
void
nexttag(const char *arg) {
        unsigned int i, j;

        memcpy(prevtags, seltags, sizeof seltags);
        for (i = 0; i < LENGTH(tags); i++) {
                if (seltags[i])
                        j = (i + 1) % LENGTH(tags);
                seltags[i] = False;
        }
        seltags[j] = True;
        arrange();
}

In your config.h keybindings:
{ MODKEY, XK_n, nexttag, NULL },

Obviously you would want to write a prevtag function as well, and
probably make sure my code works (I can't say that I've actually tested
it). In any case, this is the beauty of dwm - it really doesn't take
long to hack it to do what you want.

If the suggestion I've made doesn't work, I could do it properly, test,
and post a patch if you like.

Joerg van den Hoff wrote:
> simple question:
>
> there seems to be no pre-defined way to cycle forward/backward
> through tag-groups (still essentially a.k.a. workspaces to
> me, though I understand there's a difference). only mod1+[1..9] and
> mod1+tab seem to be in place for navigation. from my experience
> with `ion' I find the cycling (next/previous) between workspaces most useful,
> especially when searching for a certain window.
>
> question: can (and should) it be done?
>
> joerg
>
>
Received on Thu Jan 31 2008 - 23:02:21 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:17:58 UTC