end
end
+local function sorted_pairs(t, f)
+ local a = {}
+ for n in pairs(t) do table.insert(a, n) end
+ table.sort(a, f)
+ local i = 0 -- iterator variable
+ local iter = function () -- iterator function
+ i = i + 1
+ if a[i] == nil then return nil
+ else return a[i], t[a[i]]
+ end
+ end
+ return iter
+end
+
local function print_table(tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
-- }}}
-- {{{ Tags
+tags = {}
+tags.config = {}
+tags.config["main"] = {
+ t1 = { layout = layout_default, selected = true },
+ t2 = { layout = layout_default },
+ t3 = { layout = layout_tiled },
+ t4 = { layout = layout_tiled },
+ t5 = { layout = layout_tiled },
+ t6 = { layout = layout_floating },
+ t7 = { layout = layout_maximised },
+ t8 = { layout = layout_maximised },
+ t9 = { layout = layout_maximised },
+}
+tags.config["aux"] = {
+ t1 = { layout = layout_default, selected = true },
+ t2 = { layout = layout_default },
+ t3 = { layout = layout_tiled },
+ t4 = { layout = layout_floating },
+ t5 = { layout = layout_floating },
+ t6 = { layout = layout_floating },
+ t7 = { layout = layout_floating },
+ t8 = { layout = layout_floating },
+ t9 = { layout = layout_maximised },
+}
+
+screentags = {}
+screentags[1] = tags.config["main"]
+if screen.count() == 2 then -- aux screen is on the right
+ screentags[2] = tags.config["aux"]
+elseif screen.count() == 3 then -- main screen is still #1 in the middle
+ screentags[2] = tags.config["aux"]
+ screentags[3] = tags.config["aux"]
+end
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
--DISABLED-- gears.wallpaper.maximized(wallpaper, s, true)
--DISABLED--end
- -- Each screen has its own tag table.
- tags = awful.tag.new({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, layout_default)
- tags[7].layout = layout_maximised
- tags[8].layout = layout_maximised
- tags[9].layout = layout_maximised
- tags[1].selected = true
+ if not tags[s.index] then
+ tags[s.index] = {}
+ end
+ for n,p in sorted_pairs(screentags[s.index]) do
+ p["screen"] = s
+ n = string.sub(n, 2) -- remove leading 't' needed for syntax in table
+ table.insert(tags[s.index], awful.tag.add(n, p))
+ end
-- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt()