Re: [dwm] faster focus to client

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Sun, 20 Apr 2008 19:42:07 +0200

On Fri, Apr 18, 2008 at 01:28:13AM +0200, yy wrote:
> 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.

There has been a similiar approach which I had in mind for 4.7
already, but for some reasons it has been delayed. Due the fact
that we can view multiple tags, the idea was to implement two
two additional focus-functions which focus the next/prev client
with exactly the same tag(s) of the current client, which are
bound to the Mod1-Shift-{j,k}.

I reconsider this now for dwm-5.0.

Kind regards,

-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
Received on Sun Apr 20 2008 - 19:42:07 UTC

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