local awful = require('awful') local wibox = require('wibox') local gears = require('gears') local vicious = require("../vicious") local battery = require('../widgets/battery') --local volume = require('../widgets/volume') local date = require('../widgets/date') require("../modules.widget") modkey = "Mod4" -- Keyboard map indicator and switcher mykeyboardlayout = awful.widget.keyboardlayout() screen.connect_signal("request::desktop_decoration", function(s) -- Each screen has its own tag table. awful.tag({ "main", "term", "dev", "browse", "social", "misc" }, s, awful.layout.layouts[1]) -- Create a promptbox for each screen s.mypromptbox = awful.widget.prompt() -- Create an imagebox widget which will contain an icon indicating which layout we're using. -- We need one layoutbox per screen. s.mylayoutbox = awful.widget.layoutbox { screen = s, buttons = { awful.button({ }, 1, function () awful.layout.inc( 1) end), awful.button({ }, 3, function () awful.layout.inc(-1) end), awful.button({ }, 4, function () awful.layout.inc( 1) end), awful.button({ }, 5, function () awful.layout.inc(-1) end), } } -- Create a taglist widget s.mytaglist = awful.widget.taglist { screen = s, filter = awful.widget.taglist.filter.all, widget_template = { { { { id = 'text_role', widget = wibox.widget.textbox, }, layout = wibox.layout.fixed.horizontal, }, left = 18, right = 18, widget = wibox.container.margin }, id = 'background_role', widget = wibox.container.background, }, buttons = { awful.button({ }, 1, function(t) t:view_only() end), awful.button({ modkey }, 1, function(t) if client.focus then client.focus:move_to_tag(t) end end), awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ modkey }, 3, function(t) if client.focus then client.focus:toggle_tag(t) end end), awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end), } } -- Create a tasklist widget s.mytasklist = awful.widget.tasklist { screen = s, filter = awful.widget.tasklist.filter.currenttags, buttons = { awful.button({ }, 1, function (c) c:activate { context = "tasklist", action = "toggle_minimization" } end), awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 250 } } end), awful.button({ }, 4, function() awful.client.focus.byidx( 1) end), awful.button({ }, 5, function() awful.client.focus.byidx(-1) end), } } -- Create the wibox s.mywibox = awful.wibar({ position = "top", height = 48, screen = s }) -- Add widgets to the wibox s.mywibox.widget = { layout = wibox.layout.align.horizontal, { -- Left widgets layout = wibox.layout.fixed.horizontal, mylauncher, s.mytaglist, s.mypromptbox, s.mytasklist }, nil, -- s.mytasklist, -- Middle widget { -- Right widgets layout = wibox.layout.fixed.horizontal, s.mylayoutbox, -- mykeyboardlayout, -- wibox.widget.systray(), battery, date, }, } end)