editor_cmd = terminal .. " -e " .. editor
-- Wallpaper {{{1
-if beautiful.wallpaper then
- for s = 1, screen.count() do
- gears.wallpaper.maximized(beautiful.wallpaper, s, true)
+local function set_wallpaper(s)
+ -- Wallpaper
+ if beautiful.wallpaper then
+ local wallpaper = beautiful.wallpaper
+ -- If wallpaper is a function, call it with the screen
+ if type(wallpaper) == "function" then
+ wallpaper = wallpaper(s)
+ end
+ gears.wallpaper.maximized(wallpaper, s, true)
end
end
+-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
+screen.connect_signal("property::geometry", set_wallpaper)
+
-- Require files {{{1
require("bindings")
require("tags")
end))
-for s = 1, screen.count() do
+awful.screen.connect_for_each_screen(function(s)
-- Create a promptbox for each screen
- mypromptbox[s] = awful.widget.prompt()
+ s.mypromptbox = awful.widget.prompt()
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen.
- mylayoutbox[s] = awful.widget.layoutbox(s)
- mylayoutbox[s]:buttons(awful.util.table.join(
+ s.mylayoutbox = awful.widget.layoutbox(s)
+ s.mylayoutbox:buttons(awful.util.table.join(
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
-- Create a taglist widget
- mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
+ s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
-- Create a tasklist widget
- mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
+ s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
-- Create the wibox
- mywibox[s] = awful.wibox({ position = "top", screen = s })
+ s.mywibox = awful.wibox({ position = "top", 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])
+ left_layout:add(s.mytaglist)
+ left_layout:add(s.mypromptbox)
-- 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
+ right_layout:add(wibox.widget.systray())
right_layout:add(separator)
right_layout:add(require("widgets/awesompd"))
right_layout:add(require("widgets/volume_widget"))
right_layout:add(require("widgets/network_widget"))
right_layout:add(separator)
right_layout:add(require("widgets/calendar"))
- right_layout:add(mylayoutbox[s])
+ right_layout:add(s.mylayoutbox)
-- Now bring it all together (with the tasklist in the middle)
local layout = wibox.layout.align.horizontal()
layout:set_left(left_layout)
- layout:set_middle(mytasklist[s])
+ layout:set_middle(s.mytasklist)
layout:set_right(right_layout)
- mywibox[s]:set_widget(layout)
-end
+ s.mywibox:set_widget(layout)
+end)