doc: Support multiple screens in the "default look" template.

This commit is contained in:
Emmanuel Lepage Vallee 2021-09-09 16:44:55 -07:00
parent 6b7ecc51f8
commit e55ea2b0d5
1 changed files with 88 additions and 77 deletions

View File

@ -3,16 +3,25 @@ local wibox = require("wibox")
local beautiful = require("beautiful") local beautiful = require("beautiful")
require("_date") require("_date")
local ret = nil
for i = 1, screen.count() do
local s = screen[i]
-- Create the same number of tags as the default config -- Create the same number of tags as the default config
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, screen[1], awful.layout.layouts[1]) awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
local mykeyboardlayout = awful.widget.keyboardlayout() local mykeyboardlayout = awful.widget.keyboardlayout()
local mytextclock = wibox.widget.textclock() local mytextclock = wibox.widget.textclock()
local mylayoutbox = awful.widget.layoutbox(screen[1]) local mylayoutbox = awful.widget.layoutbox(s)
local mytaglist = awful.widget.taglist(screen[1], awful.widget.taglist.filter.all, {}) local mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, {})
local mytasklist = awful.widget.tasklist(screen[1], awful.widget.tasklist.filter.currenttags, {}) local mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, {})
local mypromptbox = wibox.widget.textbox("") local mypromptbox = wibox.widget.textbox("")
local wb = awful.wibar { position = "top" } local wb = awful.wibar {
position = "top",
screen = s
}
wb:setup { wb:setup {
layout = wibox.layout.align.horizontal, layout = wibox.layout.align.horizontal,
{ {
@ -45,7 +54,6 @@ wb:setup {
}, },
} }
client.connect_signal("request::titlebars", function(c) client.connect_signal("request::titlebars", function(c)
local top_titlebar = awful.titlebar(c, { local top_titlebar = awful.titlebar(c, {
height = 20, height = 20,
@ -76,9 +84,7 @@ client.connect_signal("request::titlebars", function(c)
} }
end) end)
require("gears.timer").run_delayed_calls_now() ret = ret or {
return {
mykeyboardlayout = mykeyboardlayout, mykeyboardlayout = mykeyboardlayout,
mytextclock = mytextclock , mytextclock = mytextclock ,
mylayoutbox = mylayoutbox , mylayoutbox = mylayoutbox ,
@ -87,3 +93,8 @@ return {
mywibox = wb , mywibox = wb ,
mypromptbox = mypromptbox , mypromptbox = mypromptbox ,
} }
end
require("gears.timer").run_delayed_calls_now()
return ret