2016-04-14 30 views

回答

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)