使用layout.fixed时任务列表的中心位置

use*_*904 3 awesome-wm

我对顶部栏使用以下设置:

  -- Create a promptbox for each screen
  s.mypromptbox = awful.widget.prompt()

  -- Create a taglist widget
  s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)

  -- Create a tasklist widget
  s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons)

  -- Create the wibox
  s.mywibox = awful.wibar({ position = theme.position, screen = s, height = theme.height })

  -- Add widgets to the wibox
  s.mywibox:setup {
    layout = wibox.layout.align.horizontal,
    {
      -- Left widgets
        layout = wibox.layout.fixed.horizontal,
        s.mytaglist,
        s.mypromptbox,
    },
    s.mytasklist, -- Middle widget
    {
    -- Right widgets
      layout = wibox.layout.fixed.horizontal,
      theme.systray,
      theme.spr_left,
      theme.volume,
      theme.battery,
      theme.clock,
      theme.spr_right
    },
  }
Run Code Online (Sandbox Code Playgroud)

这导致: 在此输入图像描述

我已经禁用了任务的名称。我想要完成的是将任务列表的图标显示在中心。我怎样才能做到这一点,同时保留左侧的标签和右侧的系统托盘?

编辑

当应用Expand = Outside时,我得到以下结果:

在此输入图像描述

编辑2

当我添加这些容器设置时:

-- Tasklist container
local tl = wibox.container.background(s.mytasklist, theme.bg_normal, gears.shape.rectangle)
local pl = wibox.container.margin(tl, 2, 2, 3, 3)
local tasklist = wibox.container.place(pl, {halign="center"})
Run Code Online (Sandbox Code Playgroud)

我得到:

在此输入图像描述

哪个好一点,但仍然没有完全居中。

use*_*904 6

我通过对水平对齐应用expand =“none”解决了这个问题。如下:

-- Add widgets to the wibox
s.mywibox:setup {
    layout = wibox.layout.align.horizontal,
    expand = "none",
    {
      -- Left widgets
        layout = wibox.layout.fixed.horizontal,
        s.mytaglist,
        s.mypromptbox,
    },
      -- Middle widget
      s.mytasklist,
    {
    -- Right widgets
      layout = wibox.layout.fixed.horizontal,
      theme.systray,
      theme.spr_left,
      theme.volume,
      theme.battery,
      theme.clock,
      theme.spr_right
    },
  }
end)
Run Code Online (Sandbox Code Playgroud)

在 Awesome v4.2-257-g59aa4ac7 上,该栏完美对齐,如下所示:

在此输入图像描述