Re: [dwm] faster focus to client

From: yy <yiyu.jgl_AT_gmail.com>
Date: Fri, 18 Apr 2008 01:28:13 +0200

2008/4/17, pancake <pancake_AT_youterm.com>:
> What do you think about this feature? I think that could be really interesting.
>
> When you have lot of windows opened it's mostly tedious to focus a desired window
> with the keyboard. So why not tag windows with a key and make them accessible
> in a faster way?
>
> My idea is to create this code structure:
>
> void tagclient(char *);
> void focustag(char *);
>
> You can setup a keybinding for each function and then store a single char inside
> the Client structure to make it accessible with it. And we can also use the title
> of the window or a property like floating for selecting the next client to be
> focused.
>
> For example. Doing focustag(""); we will toggle between the first client in the
> list of the selected tags that are floating and non-floating clients. Like in wmii :)
>
> If we call clienttag("M"); we will focus the client tagged as 'M' or with a title
> name starting with 'M' like mplayer.
>
> Another possibility is to call clienttag("-") and make dwm capture the next key
> pressed and use it as argument focus it.
>
> I don't really think this is a good design concept, but derivated ideas are welcome!
>
>
>
>
>
> --pancake
>
>

Well, we have already got tags in dwm, I don't think we need more. As
a simple solution, you could just add this to the end of view() (you
will need to declare c too):
for(c = clients; c && !c->tags[idxoftag(arg)]; c = c->next);
focus(c);
And you could have tags for lots of letter in your keyboard. I never
lose windows (I don't use many of them, and I focus mostly with the
mouse), but I understand it can be a problem for some people. Of
course, it wouldn't always work with my patch to view the previous
tags, but you get the idea.
Another option is having this in config.h:
        { MODKEY|ShiftMask, XK_j,
focusnext, NULL },
        { MODKEY|ShiftMask, XK_j,
focusnext, NULL },
        { MODKEY|ShiftMask, XK_j,
focusnext, NULL },
        { MODKEY|ShiftMask, XK_j,
focusnext, NULL },
so you can advance several clients with only one key stroke.

hth,

-- 
- yiyus || JGL .
Received on Fri Apr 18 2008 - 01:28:15 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:34:05 UTC