On Mon, Mar 08, 2010 at 11:15:22AM +0100, Cédric Macquat wrote:
> Hello,
> 
> I have some toubles to install the module shifty and after several tries
> I can't figure out what is wrong. With my actual version I become the tags
> defined in my rc.lua but no keybindings are working. After the start of
> awesome I can do nothing. Any idea ?
> 

..snip.. 

this is a problem:

> -- Bind all key numbers to tags.
> -- Be careful: we use keycodes to make it works on any keyboard layout.
> -- This should map on the top row of your keyboard, usually 1 to 9.
> for i = 1, keynumber do
>     globalkeys = awful.util.table.join(globalkeys,
>         awful.key({ modkey }, "#" .. i + 9,
>                   function ()
>                         local screen = mouse.screen
>                         if tags[screen][i] then
>                             awful.tag.viewonly(tags[screen][i])
>                         end
>                   end),
>         awful.key({ modkey, "Control" }, "#" .. i + 9,
>                   function ()
>                       local screen = mouse.screen
>                       if tags[screen][i] then
>                           awful.tag.viewtoggle(tags[screen][i])
>                       end
>                   end),
>         awful.key({ modkey, "Shift" }, "#" .. i + 9,
>                   function ()
>                       if client.focus and tags[client.focus.screen][i]
> then
>                           awful.client.movetotag(tags[client.focus.screen][i])
>                       end
>                   end),
>         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
>                   function ()
>                       if client.focus and tags[client.focus.screen][i]
> then
>                           awful.client.toggletag(tags[client.focus.screen][i])
>                       end
>                   end))
> end

this (at least) is all wrong now. you no longer have a table of tags. In
say the default rc.lua, there is a loop that creates tags from 1-9, and
puts them in a table called 'tags'. I suspect you're getting some index
error that is locking up awesome when it tries to process theses
keybindings.

Here is the equivalent code for shifty'ish keybindings:

for i = 1, 9 do
    globalkeys = awful.util.table.join(globalkeys,
    awful.key({ settings.modkey }, i, function()
        awful.tag.viewonly(shifty.getpos(i)) end),
    awful.key({ settings.modkey, "Control" }, i, function()
        this_screen = awful.tag.selected().screen
        t = shifty.getpos(i, this_screen) 
        t.selected = not t.selected
    end),
    awful.key({ settings.modkey, "Shift" }, i, function ()
        if client.focus then 
            local c = client.focus
            slave = not ( client.focus == awful.client.getmaster(mouse.screen))
            t = shifty.getpos(i)
            awful.client.movetotag(t,c)
            awful.tag.viewonly(t)
            if slave then awful.client.setslave(c) end
        end 
    end)
    )
end


I don't see anything glaringly obvious aside from that, ofc I could have
missed some things too.

what version of awesome are you using?

I tend to follow -git and do a very poor job of tagging anything in
github wrt to major releases. 

If you want to find somehting that is known compatible with a particular
version then koniu's repo would be more useful.

cheers,
perry


-- 
To unsubscribe, send mail to [email protected].

Reply via email to