【发布时间】:2016-04-15 23:36:27
【问题描述】:
modkey+j 或 modkey+k 仅在同一标签中的客户端之间循环。 我如何在所有客户中循环而不考虑他们的标签?有可能吗?
谢谢
【问题讨论】:
标签: awesome-wm
modkey+j 或 modkey+k 仅在同一标签中的客户端之间循环。 我如何在所有客户中循环而不考虑他们的标签?有可能吗?
谢谢
【问题讨论】:
标签: awesome-wm
没有内置这样的功能,但以下可能有效(未经测试):
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)
【讨论】: