Assigning awesome keybinding for more than 9 tags

awesomedesktopkeyboard shortcutswindow-manager

I'm using the awesome WM and the nine default tags (or "virtual desktops") are not anywhere near enough for me: I've got a lot of VMs and remote VNCs etc. In the past I've used window managers with about 20 virtual desktops and that was about right. But now that I tried awesome there's no way I'm ever going back to a non-tiling WM ; )

I managed to create more than nine tags in awesome by changing this line from my rc.lua:

tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])

to this:

tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9, "a" }, s, layouts[1])

However I really don't understand how to add a keybinding so that I can directly switch to this new tag.

I'd like to point out that going to the tag '9' and then 'going to the next tab' works perfectly, but I'm looking for a direct shortcut.

Every single thing I tried ended up in awesome basically either being unusable or defaulting to the default config.

For example I tried a lot of variations on this:

awful.key({ modkey,           }, "a",      awful.tag.viewidx XXX,

but they all miserably failed.

Note that seen that my lua-fu is not strong I'd need not only the exact line that would work but also a very precise location as to where I could put that line in my rc.lua file.

EDIT There's obviously some SNAFU when it comes to viewidx's documentation which does not match what the code does as I've found patches and mailing-list activity related to this issue. Yet I'd like to know what needs to be done to solve my problem…

Best Answer

I couldn't make the viewidx method working but I ended up doing the following, which worked:

awful.key({ modkey, }, "a", function ()
    local screen = mouse.screen
    if tags[screen][10] then
         awful.tag.viewonly(tags[screen][10]) end end),
Related Question