Guest User

Untitled

a guest
Jun 18th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.42 KB | None | 0 0
  1. -- {{{ Wibox
  2. -- Create a textclock widget
  3. mytextclock = awful.widget.textclock({ align = "right" })
  4.  
  5. -- Create a Hello World widget
  6. helloWidget = widget({ type = "textbox" })
  7. helloWidget.text = "Hola Mundo!"
  8.  
  9. -- Create a systray
  10. mysystray = widget({ type = "systray" })
  11.  
  12. -- Create a wibox for each screen and add it
  13. mywibox = {}
  14. mypromptbox = {}
  15. mylayoutbox = {}
  16. mytaglist = {}
  17. mytaglist.buttons = awful.util.table.join(
  18.                     awful.button({ }, 1, awful.tag.viewonly),
  19.                     awful.button({ modkey }, 1, awful.client.movetotag),
  20.                     awful.button({ }, 3, awful.tag.viewtoggle),
  21.                     awful.button({ modkey }, 3, awful.client.toggletag),
  22.                     awful.button({ }, 4, awful.tag.viewnext),
  23.                     awful.button({ }, 5, awful.tag.viewprev)
  24.                     )
  25. mytasklist = {}
  26. mytasklist.buttons = awful.util.table.join(
  27.                      awful.button({ }, 1, function (c)
  28.                                               if c == client.focus then
  29.                                                   c.minimized = true
  30.                                               else
  31.                                                   if not c:isvisible() then
  32.                                                       awful.tag.viewonly(c:tags()[1])
  33.                                                   end
  34.                                                   -- This will also un-minimize
  35.                                                   -- the client, if needed
  36.                                                   client.focus = c
  37.                                                   c:raise()
  38.                                               end
  39.                                           end),
  40.                      awful.button({ }, 3, function ()
  41.                                               if instance then
  42.                                                   instance:hide()
  43.                                                   instance = nil
  44.                                               else
  45.                                                   instance = awful.menu.clients({ width=250 })
  46.                                               end
  47.                                           end),
  48.                      awful.button({ }, 4, function ()
  49.                                               awful.client.focus.byidx(1)
  50.                                               if client.focus then client.focus:raise() end
  51.                                           end),
  52.                      awful.button({ }, 5, function ()
  53.                                               awful.client.focus.byidx(-1)
  54.                                               if client.focus then client.focus:raise() end
  55.                                           end))
  56.  
  57. for s = 1, screen.count() do
  58.     -- Create a promptbox for each screen
  59.     mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
  60.     -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  61.     -- We need one layoutbox per screen.
  62.     mylayoutbox[s] = awful.widget.layoutbox(s)
  63.     mylayoutbox[s]:buttons(awful.util.table.join(
  64.                            awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
  65.                            awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
  66.                            awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
  67.                            awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
  68.     -- Create a taglist widget
  69.     mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.label.all, mytaglist.buttons)
  70.  
  71.     -- Create a tasklist widget
  72.     mytasklist[s] = awful.widget.tasklist(function(c)
  73.                                               return awful.widget.tasklist.label.currenttags(c, s)
  74.                                           end, mytasklist.buttons)
  75.  
  76.     -- Create the wibox
  77.     mywibox[s] = awful.wibox({ position = "top", screen = s })
  78.     -- Add widgets to the wibox - order matters
  79.     mywibox[s].widgets = {
  80.         {
  81.             mylauncher,
  82.             mytaglist[s],
  83.             mypromptbox[s],
  84.             layout = awful.widget.layout.horizontal.leftright
  85.         },
  86.         mylayoutbox[s],
  87.         mytextclock,
  88.         s == 1 and mysystray or nil,
  89.         mytasklist[s],
  90.         layout = awful.widget.layout.horizontal.rightleft
  91.     }
  92. end
  93. -- }}}
Add Comment
Please, Sign In to add comment