How would I focus on specific client in awesome window manager by pressing Alt-1 to first window, Alt-2 to go to second window, and so on? I made this script but it doesn't work properly, it selects random windows:
awful.key({"Mod1" }, "1",
function ()
awful.client.focus.byidx(1)
if client.focus then
client.focus:raise()
end
end ),
awful.key({"Mod1" }, "2",
function ()
awful.client.focus.byidx(2)
if client.focus then
client.focus:raise()
end
end ),
awful.key({"Mod1" }, "3",
function ()
awful.client.focus.byidx(3)
if client.focus then
client.focus:raise()
end
end ),