是否可以使任务列表自动切换到不同的布局?



我使用以下代码为我的wibartasklist:

s.mytasklist = awful.widget.tasklist
{
screen   = s,
filter   = awful.widget.tasklist.filter.allscreen,
buttons  = tasklist_buttons,
layout   = wibox.layout.fixed.horizontal(),

widget_template =
{
{
{
{
id     = 'clienticon',
widget = awful.widget.clienticon,
},
margins = 0,
widget  = wibox.container.margin,
},
{
id     = 'text_role',
widget = wibox.widget.textbox,
},
layout = wibox.layout.fixed.horizontal,
},

id              = 'background_role',
forced_width    = 200,
forced_height   = 60,
widget = wibox.container.background,
create_callback = function(self, c, index, objects)
self:get_children_by_id('clienticon')[1].client = c
end,
},
}
s.mytasklist_onlyminimised = awful.widget.tasklist
{
screen   = s,
filter   = awful.widget.tasklist.filter.minimizedcurrenttags,
buttons  = tasklist_buttons,
style    = {
shape_border_width = 1,
shape_border_color = '#333333',
shape  = gears.shape.partially_rounded_rect,
},
}

这使得任务列表上的任务具有固定宽度(根据此答案)

我的问题是:

任务列表时是否可以将任务列表切换到wibox.layout.flex.horizontal充满了任务?

虽然你可以在技术上取代任务列表从client.connect_signal("tagged", function(c) if #c.screen.selected_tag:clients() >= some_number then <make_a_new_tasklist> end end)风格的代码,这是相当便宜和丑陋的。

所以我认为这需要在上游贡献一个补丁来公开标签列表/任务列表构造函数参数作为属性。awful.widget.layoutlist已经这样做了,但不是标签/任务列表。

最新更新