是否可以让任务列表自动切换到不同的布局?
Is it possible to make tasklist automatically switch to different layout?
我正在为我的 wibar tasklist 使用以下代码:
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)
样式代码的任务列表,但这非常便宜且丑陋。
所以我认为这需要在上游贡献一个补丁以将 taglist/tasklist 构造函数参数公开为属性。 awful.widget.layoutlist
已经做到了,但 tag/tasklists 没有。
我正在为我的 wibar tasklist 使用以下代码:
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)
样式代码的任务列表,但这非常便宜且丑陋。
所以我认为这需要在上游贡献一个补丁以将 taglist/tasklist 构造函数参数公开为属性。 awful.widget.layoutlist
已经做到了,但 tag/tasklists 没有。