Including the list as well. ---------- Forwarded message ---------- From: V. Todorov <[email protected]> Date: Wed, Apr 9, 2014 at 4:41 PM Subject: Re: Get the current client from a global key callback To: Halim Zaghdoudi <[email protected]>
Hi, Thanks for the replies. Actually I am no trying to move a client to a tag - tag switching by numbers is perfect. But find the client - I have tons of clients open - I would like to search for a client and bring it to front (and if I need switch the tag too - if the client is assigned to one tag only. A good point is what to do if the client is assigned to multiple tags but I will figure it out). Regards, /v On Wed, Apr 9, 2014 at 4:38 PM, Halim Zaghdoudi <[email protected]> wrote: > Isn't it very handy to access tabs by the numbers, too? :D > But i think your idea should be doable. You get a string from the prompt, > and then just use the api to move the currently focused client to the tag > named like the string. If this tag doesn't exist, you create it. And then > for your other keybinding you just get a string from the prompt and then > watch the given tag via awful.tag.viewonly(), Problem would be the tag > creation, I tried it once to write my own functions, but had various > problems with updating the taglist in my wibox. Finally you could add a > keybinding-function which will clear all unused tags. > > *Gesendet:* Mittwoch, 09. April 2014 um 15:21 Uhr > *Von:* "V. Todorov" <[email protected]> > *An:* "Awesome Mailinglist" <[email protected]> > *Betreff:* Get the current client from a global key callback > Hello, > > I have a simple question. How can I get the current (focused) client from > a global key callback? > I searched google (well didn't spend more than 10 minutes because I didn't > have much time, so I guess I will have to waste yours ; ) but anyway I am > on my way to implement a simple and handy feature - something similar to > easymotion vim plugin - I don't know if it is already implemented. > Here is what it should do: > A user will be able to press a global key combination and get a prompt > where he can assign a 'tag' (a string) to the currently focused window. > Then he can do the same thing for another window. Then he can press another > key combination and enter a tag which will select the window that has the > specified tag assigned and it will bring it infront. > > This is my first global key definition: > > -- set 'switch-to' tag on the focused client > awful.key({ modkey}, "\\", function () > awful.prompt.run({ prompt = "switch-to tag: ", text = > awful.client.switchtotag, }, > mypromptbox[mouse.screen].widget, > function (s) > awful.client.switchtotag = s > end) > end) > > The problem with this is that client.switchtotag is a static variable - > available to all clients I guess. I want it to be instance variable - > instance of switchtotag per client. How can I do that? > > Currently when I press Win+\ and assign a tag to a terminal, and then do > the same thing for eclipse for example I will change the tag of the > terminal. One thing that comes to my mind is to assign this key shortcut to > a client - not global - but I have the feeling that I will like it more if > it is global. What do you think? > > And this is the basic functionality. The next thing that I want to do is > exactly what easymotion does. > I press a key and all opened clients receive a tag (generated in some way > - and very short and easy to type). The user then enters the tag and the > client is focused. > > Regards, > /v > >
