【问题标题】:Awesome WM: How can I iterate through all clients in all tags?Awesome WM:如何遍历所有标签中的所有客户端?
【发布时间】:2016-04-15 23:36:27
【问题描述】:

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

谢谢

【问题讨论】:

    标签: awesome-wm


    【解决方案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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-12
      • 1970-01-01
      • 2018-09-16
      相关资源
      最近更新 更多