答案1
今天这相当容易。假设您的 中定义了以下布局rc.lua
:
awful.layout.layouts = {
awful.layout.suit.tile,
awful.layout.suit.tile.bottom,
}
您awful.screen.connect_for_each_screen(func)
可以为每个现有的和将来创建的屏幕调用一个函数。您很可能已经有这样的调用rc.lua
(例如设置壁纸或创建标签)。根据您的配置,您需要这样的东西:
awful.screen.connect_for_each_screen(function(s)
if s.geometry.width >= s.geometry.height then
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" }, s, awful.layout.layouts[1])
else
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9", "0" }, s, awful.layout.layouts[2])
end
end)