You are not logged in.

#1 2010-02-15 19:03:26

grine
Member
Registered: 2010-02-09
Posts: 38

[Solved] Making Awesome focus on master window after changing tags.

I want Awesome to give focus to the Master window whenever I switch tags, is there some way to do this in rc.lua?

Also, whenever I copy a window to another tag it loses focus, this is pretty annoying when I'm copying for example my ssh/irssi session to alot of desktops.

Any Awesome pro who knows a solution?

Last edited by grine (2010-02-16 07:58:05)

Offline

#2 2010-02-15 20:51:17

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: [Solved] Making Awesome focus on master window after changing tags.

grine wrote:

I want Awesome to give focus to the Master window whenever I switch tags, is there some way to do this in rc.lua?

Also, whenever I copy a window to another tag it loses focus, this is pretty annoying when I'm copying for example my ssh/irssi session to alot of desktops.

Any Awesome pro who knows a solution?

To get the currently focused client (aka window):

c = client.focus

To get the master client on the current tag:

c = awful.client.getmaster()

To give focus to a client saved in c:

if c then
    client.focus = c
    c:raise()
end

So now the issue is just how to invoke these. You could insert them into the key/mouse button commands that switch tags, or that copy a client to another tag.

Or, to handle your request to always give focus to the master, you could try instead doing something like:

each_tag:add_signal("the_right_signal", function(thistag) do_your_focus_master_stuff end).

each_tag and the_right_signal and do_your_focus_master_stuff are just schematic variables, you have to fill in the details.

Check out the Awesome wiki for a draft lift of signals. (I started it, I hope others will help refine it.)

Offline

#3 2010-02-15 20:55:22

grine
Member
Registered: 2010-02-09
Posts: 38

Re: [Solved] Making Awesome focus on master window after changing tags.

Thanks alot, Awesome really needs more documentation.

Getting it to focus the master worked fine, keeping focus after copying is more troublesome though.

It seems it's only a problem when I'm copying a terminal window with another window (i.e. Opera) next to it, then the other one will will steal the focus. Two terminal windows is not a problem, wierd stuff. I'm gonna keep looking at it.

Last edited by grine (2010-02-15 21:42:09)

Offline

#4 2010-02-15 21:06:35

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 835
Website

Re: [Solved] Making Awesome focus on master window after changing tags.

grine wrote:

I want Awesome to give focus to the Master window whenever I switch tags, is there some way to do this in rc.lua?

If you require awful.autofocus in your rc.lua then you are explicitly telling it not to. Check what it does, and how it determines what client should get focus. You can then reuse that code in your rc.lua, only changing the point where it selects a client that should get focus.

grine wrote:

Also, whenever I copy a window to another tag it loses focus, this is pretty annoying when I'm copying for example my ssh/irssi session to alot of desktops.

Please see this link http://awesome.naquadah.org/bugs/index. … ask_id=700

grine wrote:

Thanks alot, Awesome really needs more documentation.

Maybe it does. But not for things you are asking about, it has pleanty of that kind.


You need to install an RTFM interface.

Offline

#5 2010-02-15 21:44:17

grine
Member
Registered: 2010-02-09
Posts: 38

Re: [Solved] Making Awesome focus on master window after changing tags.

Maybe it doesn't need MORE docs, they could be structured in a sane way though.

The docs doesn't say much and reading rc.luas all day makes my head hurt. Guess i should start working on their wiki myself...

Edit: That link was great though, thank you very much.

Last edited by grine (2010-02-15 21:49:11)

Offline

Board footer

Powered by FluxBB