1

Using the awesome window manager (version 3.5.6), I'm looking for a way to move may focus to the left/right/up/down relative to my currently focused client. For instance, given this layout:

+-----+-----+-----+
|     |     |     |
|  A  |  B  |  C  |
|     |     |     |
+-----+-----+-----+

If the focus is on client A, I'd like a keyboard shortcut that moved the focus to client B. Pressing it again would focus on client C and pressing it another time would do nothing. Other shortcuts would move to the right, up or down.

I know how to bind commands to keyboard shortcuts in my rc.lua but not which command I could use here, so any help would be appreciated!

JDługosz
  • 540

1 Answers1

4

I believe you are looking for awful.client.focus.by_direction.

https://awesomewm.org/apidoc/classes/client.html#awful.client.focus.bydirection

For example:

# dir The direction, can be either "up", "down", "left" or "right". 
awful.key({ modkey,           }, "j", function ()
    awful.client.focus.bydirection("down")                        
end)
Al.G.
  • 269
  • 1
  • 3
  • 14