awesome任务栏新窗口排列到右侧

默认情况下新窗口在 任务栏排列到左侧,感觉很奇怪

编辑 /usr/share/awesome/lib/awful/widget/tasklist.lua

找到函数 tasklist_update

table.insert(clients, c) 修改为table.insert(clients,1, c)

完整函数

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
local function tasklist_update(s, w, buttons, filter, data, style, update_function, args)
    local clients = {}

    local source = args and args.source or tasklist.source.all_clients or nil
    local list   = source and source(s, args) or capi.client.get()

    for _, c in ipairs(list) do
        if not (c.skip_taskbar or c.hidden
            or c.type == "splash" or c.type == "dock" or c.type == "desktop")
            and filter(c, s) then
            -- table.insert(clients, c)
            table.insert(clients,1, c)
        end
    end

    local function label(c, tb) return tasklist_label(c, style, tb) end

    update_function(w, buttons, label, data, clients, args)
end

参考: https://blog.csdn.net/joshua2011/article/details/78636809

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计