在移植到Awesome 3.5.1之前,我的屏幕頂部有兩個面板(彼此頂部),底部沒有任何面板。該代碼我用來實現這一預3.5 *低於:真棒3.5 - 頂部的兩個面板(wiboxes)
-- Create the wibox
mywibox[s] = awful.wibox({ position = "top", height = "32", screen = s })
-- Add widgets to the wibox - order matters
mywibox[s].widgets = {
{
{
-- Upper left section
mylauncher,
mytaglist[s],
mypromptbox[s],
-- My custom widgets, separators etc...
layout = awful.widget.layout.horizontal.leftright
},
{
-- Upper right section
mylayoutbox[s],
mytextclock,
-- More widgets, separators, etc...
s == 1 and mysystray or nil,
layout = awful.widget.layout.horizontal.rightleft
},
},
{
-- Lower section (only the tasklist)
mytasklist[s],
},
layout = awful.widget.layout.vertical.flex,
height = mywibox[s].height
}
現在我有一個困難時期試圖找出如何實現與3.5的配置相同。目前,我在頂部使用了相當基本的一個面板(大多數小部件),底部使用了一個(使用任務列表)。該代碼可以看到下面:
-- Create the wibox
mywibox[s] = awful.wibox({ position = "top", height = "18", screen = s })
mywibox2[s] = awful.wibox({ position = "bottom", height = "18", screen = s })
-- Widgets that are aligned to the left
local left_layout = wibox.layout.fixed.horizontal()
left_layout:add(mylauncher)
left_layout:add(mytaglist[s])
left_layout:add(mypromptbox[s])
-- My custom widgets, separators, etc...
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
if s == 1 then right_layout:add(wibox.widget.systray()) end
-- My custom widgets, separators, etc...
right_layout:add(mytextclock)
right_layout:add(mylayoutbox[s])
-- Now bring it all together
local layout = wibox.layout.align.horizontal()
layout:set_left(left_layout)
layout:set_right(right_layout)
local layout2 = wibox.layout.align.horizontal()
layout2:set_middle(mytasklist[s])
mywibox[s]:set_widget(layout)
mywibox2[s]:set_widget(layout2)
如果任何人有想法如何編輯我目前rc.lua,使其工作爲上的代碼真棒3.4 *做,那將會是極大的讚賞。
這一個做到了。實際上,我把這兩個佈局放在一個垂直佈局中,但無法弄清楚如何爲兩個內部佈局分配正確的大小。無論如何,現在它應該如此。十分感謝! – debil