I have two monitors. How can I focus on a window that is on a different screen than the one I'm working on?
Mod+j/h works only for one monitor.
I have two monitors. How can I focus on a window that is on a different screen than the one I'm working on?
Mod+j/h works only for one monitor.
awesome refers to different monitors as screens just as you do. Check the man page for commands mentioning screen. Here are some helpful ones:
Mod4 + Control + j focus next screen
Mod4 + o send client to next screen
So to answer your question, you will probably need to first Mod4 + Control + j to the next screen, and then Mod4 + j through the clients on that screen/tag until the one you want is in focus.
You can also configure the keys in .config/awesome/rc.lua.
The default binding Mod4 + o only moves a client to the screen on the right. You can also add a keybinding to move to the left.
In the following example, I mapped Mod4 + Control + [j|k] to move the focus to the screen left/right. And if you also hold down the Shift key then it also moves the currently focused window along with it.
globalkeys = gears.table.join(
-- ...
awful.key({ modkey, "Control" }, "j",
function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k",
function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
-- ...
)
clientkeys = gears.table.join(
-- ...
awful.key({ modkey, "Control", "Shift" }, "k",
function (c) c:move_to_screen(c.screen.index - 1) end,
{description = "move to screen left", group = "client"}),
awful.key({ modkey, "Control", "Shift" }, "j",
function (c) c:move_to_screen(c.screen.index + 1) end,
{description = "move to screen right", group = "client"}),
-- ...
)