diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-07-23 11:08:21 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-07-23 11:08:21 -0300 |
commit | b0510ce32cf33900d7918392701943a9817cbf71 (patch) | |
tree | cf2cd16795098e832b7e55989bec93696dfa005f /config.dot/awesome.link/wibox.lua | |
parent | 276f9a4e1f00f24d0a00615e74e4c0f5eb6e9c83 (diff) | |
download | awesome-b0510ce32cf33900d7918392701943a9817cbf71.tar.gz awesome-b0510ce32cf33900d7918392701943a9817cbf71.tar.bz2 |
Move stuff away from rc.lua
Diffstat (limited to 'config.dot/awesome.link/wibox.lua')
-rw-r--r-- | config.dot/awesome.link/wibox.lua | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/config.dot/awesome.link/wibox.lua b/config.dot/awesome.link/wibox.lua new file mode 100644 index 0000000..d1cc5c5 --- /dev/null +++ b/config.dot/awesome.link/wibox.lua @@ -0,0 +1,122 @@ +-- {{{ Wibox + +-- Create a wibox for each screen and add it +mywibox = {} +mypromptbox = {} +mylayoutbox = {} +mytaglist = {} +mytaglist.buttons = awful.util.table.join( + awful.button({ }, 1, awful.tag.viewonly), + awful.button({ modkey }, 1, awful.client.movetotag), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, awful.client.toggletag), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) + ) + +mytasklist = {} +mytasklist.buttons = awful.util.table.join( + awful.button({ }, 1, function (c) + if not c:isvisible() then + awful.tag.viewonly(c:tags()[1]) + end + client.focus = c + c:raise() + end), + awful.button({ }, 3, function () + if instance then + instance:hide() + instance = nil + else + instance = awful.menu.clients({ width=250 }) + end + end), + awful.button({ }, 4, function () + awful.client.focus.byidx(1) + if client.focus then client.focus:raise() end + end), + awful.button({ }, 5, function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + end)) + +-- Widgets +dofile(configdir .. "/widgets.lua") + +for s = 1, screen.count() do + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright }) + -- 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( + 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.label.all, mytaglist.buttons) + + -- Create a tasklist widget + mytasklist[s] = awful.widget.tasklist(function(c) + return awful.widget.tasklist.label.currenttags(c, s) + end, mytasklist.buttons) + + -- Create the wibox + --mywibox[s] = awful.wibox({ position = "top", screen = s }) + mywibox[s] = awful.wibox({ position = "top", screen = s, height = "16" }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { + { + mylauncher, + mytaglist[s], + mypromptbox[s], + layout = awful.widget.layout.horizontal.leftright + }, + mylayoutbox[s], + + s == 1 and mysystray or nil, + arr1, + spr3f, + binaryclock.widget, + spr3f, + arrl, + --my_cal.widget, + arr2, + --netwidget, + --neticon, + arr3, + batwidget, + baticon, + arr4, + --fswidget, + --udisks_glue.widget, + arr5, + sensors, + tempicon, + arr6, + --cpuwidget, + --cpuicon, + arr7, + --memwidget, + --memicon, + arr8, + --task_warrior.widget, + arr9, + --music, + arr0, + --mailicon, + arr9, + spr, + -- s == 1 and mysystray, spr or nil, mytasklist[s], + + --mytextclock, + --volume_widget, + --battery_widget, + myledbox, + awesompd and musicwidget.widget or nil, + mytasklist[s], + layout = awful.widget.layout.horizontal.rightleft + } +end +-- }}} |