You are not logged in.

#1 2013-02-18 22:37:28

cris9288
Member
Registered: 2013-01-07
Posts: 348

[SOLVED][Awesome 3.5] awesome rules - open/focus client on a screen

I am having trouble setting a rule in awesome. I would like to get a client to open on a specific tag and on the currently active a focused screen. The awesome FAQ has a section on this and the callback function they give works fine. There are a couple of problems though.

First, my client opens on the right tag and screen, but focus stays on the tag that i'm actually on. Second, when I switch to the tag with the new client, it is sized the way it would've appeared on the original tag. For example, if I'm on tag 1 with a browser open with a vertical tiling layout and I open my terminal (set to open on tag 3 which is set to a floating layout), when I switch to tag 3, I find that it is taking up half the screen as if it were tiled with my browser. The second problem is not so big a deal, but I would like the new client to gain immediate focus. I am aware of the switchtotag property, but it seems to be ignored and using mouse.screen in tags property doesn't work either.

This is rule I have in place:

{ rule = { class = "Xfce4-terminal" },
   callback = function(c)
                       awful.client.movetotag(tags[mouse.screen][2], c)
                       client.focus = c
                       c:raise()
                    end, 
   properties = { switchtotag = true } 
},

Anyone have any ides? I appreciate any help I can get, thanks.

EDIT: I have solved the problem of the incorrect sizing by getting rid of callback and instead placing that function in my properties array, but switchtotag is still being ignored.

Last edited by cris9288 (2013-02-19 00:18:31)

Offline

#2 2013-02-19 00:18:03

cris9288
Member
Registered: 2013-01-07
Posts: 348

Re: [SOLVED][Awesome 3.5] awesome rules - open/focus client on a screen

I solved this with the following rule

{ rule = { class = "Xfce4-terminal" },
       properties = { function(c)
                                  awful.client.movetotag(tags[mouse.screen][2], c)
                                   awful.tag.viewonly(tags[mouse.screen][2]) end } },

Offline

Board footer

Powered by FluxBB