modkey + j或modkey + k仅在同一标记中的客户端之间循环。 如何在不考虑标签的情况下循环访问所有客户?有可能吗?
由于
答案 0 :(得分:0)
内置没有此类功能,但以下内容可能有效(未经测试):
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)