-mytasklist.buttons = { button({ }, 1, function (c)
- if not c:isvisible() then
- awful.tag.viewonly(c:tags()[1])
- end
- client.focus = c
- c:raise()
- end),
- button({ }, 3, function () if instance then instance:hide() end instance = awful.menu.clients({ width=250 }) end),
- button({ }, 4, function () awful.client.focus.byidx(1) end),
- button({ }, 5, function () awful.client.focus.byidx(-1) end) }
-
-for s = 1, screen.count() do
+mytasklist.buttons = awful.util.table.join(
+ awful.button({ }, 1, function (c)
+ if c == client.focus then
+ c.minimized = true
+ else
+ -- Without this, the following
+ -- :isvisible() makes no sense
+ c.minimized = false
+ if not c:isvisible() and c.first_tag then
+ c.first_tag:view_only()
+ end
+ -- This will also un-minimize
+ -- the client, if needed
+ client.focus = c
+ c:raise()
+ end
+ end),
+ awful.button({ }, 3, client_menu_toggle_fn()),
+ awful.button({ }, 4, function ()
+ awful.client.focus.byidx(1)
+ end),
+ awful.button({ }, 5, function ()
+ awful.client.focus.byidx(-1)
+ end))
+-- }}}
+
+-- {{{ 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--if beautiful.wallpaper then
+ --DISABLED-- local wallpaper = beautiful.wallpaper
+ --DISABLED-- -- If wallpaper is a function, call it with the screen
+ --DISABLED-- if type(wallpaper) == "function" then
+ --DISABLED-- wallpaper = wallpaper(s)
+ --DISABLED-- end
+ --DISABLED-- gears.wallpaper.maximized(wallpaper, s, true)
+ --DISABLED--end
+
+ 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
+