Awesome WM: Как мне перебрать всех клиентов по всем тегам?

modkey+j или modkey+k переключаются только между клиентами в одном и том же теге. Как я могу перебирать всех клиентов, не обращая внимания на теги, которыми они являются? Является ли это возможным?

Спасибо


person Lilás    schedule 14.04.2016    source источник


Ответы (1)


Такой встроенной функции нет, но может работать следующее (не проверено):

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)
person Uli Schlachter    schedule 15.04.2016