很棒的WM:我如何在所有标签中迭代所有客户端



modkey+j或modkey+k仅在同一标记中的客户端之间循环。如何在所有客户端之间循环,而不考虑它们的标签?有可能吗?

感谢

没有内置这样的功能,但以下功能可能有效(未经测试):

function next_client_total(i)
  local c = client.focus
  if not c then return end
  local cls = client.get()
  local fcls = {}
  -- Remove all non-normal clients
  for _, c in ipairs(cls) do
    if awful.client.focus.filter(c) or c == sel then
      table.insert(fcls, c)
    end
  end
  -- Find the focused client
  for idx, c in ipairs(fcls) do
    if c == sel then
      -- Found it, focus and raise the "target"
      local c = fcls[awful.util.cycle(#fcls, idx + i)]
      client.focus = c
      c:raise()
      return
    end
  end
end

然后,添加这样的密钥绑定:

awful.key({ modkey }, "j", function() next_client_total(1) end)
awful.key({ modkey }, "k", function() next_client_total(-1) end)

最新更新