Advertisement
vorron

custom-taglist-rc.lua

Nov 8th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.53 KB | None | 0 0
  1. -- Standard awesome library
  2. local gears = require("gears")
  3. local awful = require("awful")
  4. awful.rules = require("awful.rules")
  5. require("awful.autofocus")
  6. -- Widget and layout library
  7. local wibox = require("wibox")
  8. -- Theme handling library
  9. local beautiful = require("beautiful")
  10. -- Notification library
  11. local naughty = require("naughty")
  12. local menubar = require("menubar")
  13.  
  14. -- Load Debian menu entries
  15. require("debian.menu")
  16.  
  17. -- {{{ Error handling
  18. -- Check if awesome encountered an error during startup and fell back to
  19. -- another config (This code will only ever execute for the fallback config)
  20. if awesome.startup_errors then
  21.     naughty.notify({ preset = naughty.config.presets.critical,
  22.                      title = "Oops, there were errors during startup!",
  23.                      text = awesome.startup_errors })
  24. end
  25.  
  26. -- Handle runtime errors after startup
  27. do
  28.     local in_error = false
  29.     awesome.connect_signal("debug::error", function (err)
  30.         -- Make sure we don't go into an endless error loop
  31.         if in_error then return end
  32.         in_error = true
  33.  
  34.         naughty.notify({ preset = naughty.config.presets.critical,
  35.                          title = "Oops, an error happened!",
  36.                          text = err })
  37.         in_error = false
  38.     end)
  39. end
  40. -- }}}
  41.  
  42. -- {{{ Variable definitions
  43. -- Themes define colours, icons, font and wallpapers.
  44. beautiful.init("/usr/share/awesome/themes/default/theme.lua")
  45.  
  46. -- This is used later as the default terminal and editor to run.
  47. terminal = "x-terminal-emulator"
  48. editor = os.getenv("EDITOR") or "editor"
  49. editor_cmd = terminal .. " -e " .. editor
  50.  
  51. -- Default modkey.
  52. -- Usually, Mod4 is the key with a logo between Control and Alt.
  53. -- If you do not like this or do not have such a key,
  54. -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
  55. -- However, you can use another modifier like Mod1, but it may interact with others.
  56. modkey = "Mod4"
  57.  
  58. -- Table of layouts to cover with awful.layout.inc, order matters.
  59. local layouts =
  60. {
  61.     awful.layout.suit.floating,
  62.     awful.layout.suit.tile,
  63.     awful.layout.suit.tile.left,
  64.     awful.layout.suit.tile.bottom,
  65.     awful.layout.suit.tile.top,
  66.     awful.layout.suit.fair,
  67.     awful.layout.suit.fair.horizontal,
  68.     awful.layout.suit.spiral,
  69.     awful.layout.suit.spiral.dwindle,
  70.     awful.layout.suit.max,
  71.     awful.layout.suit.max.fullscreen,
  72.     awful.layout.suit.magnifier
  73. }
  74. -- }}}
  75.  
  76. -- {{{ Wallpaper
  77. if beautiful.wallpaper then
  78.     for s = 1, screen.count() do
  79.         gears.wallpaper.maximized(beautiful.wallpaper, s, true)
  80.     end
  81. end
  82. -- }}}
  83.  
  84. --[[
  85. -- {{{ Tags
  86. -- Define a tag table which hold all screen tags.
  87. tags = {}
  88. for s = 1, screen.count() do
  89.     -- Each screen has its own tag table.
  90.     tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[1])
  91. end
  92. -- }}}
  93. -]]
  94.  
  95. -- {{{ Tags
  96. -- Define a tag table which hold all screen tags.
  97. tags = {
  98.     names  = { "1", "2", "3", "4", "5", "6" },
  99.     layout = { layouts[4], layouts[2], layouts[2], layouts[2], layouts[2], layouts[2]}
  100.     }
  101. for s = 1, screen.count() do
  102.     -- Each screen has its own tag table.
  103.     tags[s] = awful.tag(tags.names, s, tags.layout)
  104. end
  105. -- }}}
  106.  
  107. -- {{{ Menu
  108. -- Create a laucher widget and a main menu
  109. myawesomemenu = {
  110.    { "manual", terminal .. " -e man awesome" },
  111.    { "edit config", editor_cmd .. " " .. awesome.conffile },
  112.    { "restart", awesome.restart },
  113.    { "quit", awesome.quit }
  114. }
  115.  
  116. mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
  117.                                     { "Debian", debian.menu.Debian_menu.Debian },
  118.                                     { "open terminal", terminal }
  119.                                   }
  120.                         })
  121.  
  122. mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
  123.                                      menu = mymainmenu })
  124.  
  125. -- Menubar configuration
  126. menubar.utils.terminal = terminal -- Set the terminal for applications that require it
  127. -- }}}
  128.  
  129. -- {{{ Wibox
  130. -- Create a textclock widget
  131. mytextclock = awful.widget.textclock()
  132.  
  133. -- Create a wibox for each screen and add it
  134. mywibox = {}
  135. mypromptbox = {}
  136. mylayoutbox = {}
  137. mytaglist = {}
  138. mytaglist.buttons = awful.util.table.join(
  139.                     awful.button({ }, 1, awful.tag.viewonly),
  140.                     awful.button({ modkey }, 1, awful.client.movetotag),
  141.                     awful.button({ }, 3, awful.tag.viewtoggle),
  142.                     awful.button({ modkey }, 3, awful.client.toggletag),
  143.                     awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
  144.                     awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
  145.                     )
  146. mytasklist = {}
  147. mytasklist.buttons = awful.util.table.join(
  148.                      awful.button({ }, 1, function (c)
  149.                                               if c == client.focus then
  150.                                                   c.minimized = true
  151.                                               else
  152.                                                   -- Without this, the following
  153.                                                   -- :isvisible() makes no sense
  154.                                                   c.minimized = false
  155.                                                   if not c:isvisible() then
  156.                                                       awful.tag.viewonly(c:tags()[1])
  157.                                                   end
  158.                                                   -- This will also un-minimize
  159.                                                   -- the client, if needed
  160.                                                   client.focus = c
  161.                                                   c:raise()
  162.                                               end
  163.                                           end),
  164.                      awful.button({ }, 3, function ()
  165.                                               if instance then
  166.                                                   instance:hide()
  167.                                                   instance = nil
  168.                                               else
  169.                                                   instance = awful.menu.clients({
  170.                                                       theme = { width = 250 }
  171.                                                   })
  172.                                               end
  173.                                           end),
  174.                      awful.button({ }, 4, function ()
  175.                                               awful.client.focus.byidx(1)
  176.                                               if client.focus then client.focus:raise() end
  177.                                           end),
  178.                      awful.button({ }, 5, function ()
  179.                                               awful.client.focus.byidx(-1)
  180.                                               if client.focus then client.focus:raise() end
  181.                                           end))
  182.  
  183. -- подклучаем нужные модули
  184. local awcommon = require("awful.widget.common")
  185. local gcolor = require("gears.color")
  186.  
  187. -- это пользовательский виджет рисующий скосы
  188. local tag_decorator = function(dwidth, fg, bg)
  189.     local widg = wibox.widget.base.make_widget()
  190.  
  191.     widg.data = {
  192.         width = dwidth or 10,
  193.         fg = fg or "#aaaaaa",
  194.         bg = bg or "#000000"
  195.     }
  196.  
  197.     function widg:set_colors(fg, bg)
  198.         self.data.fg = fg or self.data.fg
  199.         self.data.bg = bg or self.data.bg
  200.         self:emit_signal("widget::updated")
  201.     end
  202.  
  203.     function widg:fit(width, height)
  204.         return self.data.width, height
  205.     end
  206.  
  207.     function widg:draw(wibox, cr, width, height)
  208.         cr:set_source(gcolor(self.data.bg))
  209.         cr:rectangle(0, 0, width, height)
  210.         cr:fill()
  211.  
  212.         cr:set_source(gcolor(self.data.fg))
  213.         cr:move_to(0, height)
  214.         cr:rel_line_to(0, -height)
  215.         cr:rel_line_to(width, 0)
  216.         cr:close_path()
  217.         cr:fill()
  218.     end
  219.  
  220.     return widg
  221. end
  222.  
  223. local decorator_width = 15 -- ширина скоса
  224. local first_decorator = tag_decorator(decorator_width) -- первый скос отдельно от конструктора
  225.  
  226. -- это функция-конструстор для теглиста
  227. -- здесь формируется внешний вид каждого тега
  228. -- по умолчаниню здесь была только надпись и иконка
  229. -- и теперь мы добавляем к ним виджеты-скосы
  230. local tag_constructor = function(w, buttons, label, data, objects)
  231.     local prev_decorator -- переменная для хранения предыдущего скоса
  232.     w:reset()
  233.  
  234.     -- update the widgets, creating them if needed
  235.     for i, o in ipairs(objects) do
  236.         local cache = data[o]
  237.         local ib, tb, bgb, m, l, db
  238.  
  239.         if cache then
  240.             ib  = cache.ib
  241.             tb  = cache.tb
  242.             bgb = cache.bgb
  243.             m   = cache.m
  244.             db  = cache.db
  245.         else
  246.             ib = wibox.widget.imagebox()
  247.             tb = wibox.widget.textbox()
  248.             bgb = wibox.widget.background()
  249.             m = wibox.layout.margin(tb, 0, 0) -- зануляем промежутки для нашего случая ибо не иконки не используем
  250.             l = wibox.layout.fixed.horizontal()
  251.             db = tag_decorator(decorator_width) -- виджет-скос
  252.  
  253.             -- All of this is added in a fixed widget
  254.             l:fill_space(true)
  255.             l:add(ib)
  256.             l:add(m)
  257.             l:add(db) -- добавляем виджет-скос каждому тегу после его имени
  258.  
  259.             -- And all of this gets a background
  260.             bgb:set_widget(l)
  261.  
  262.             bgb:buttons(awcommon.create_buttons(buttons, o))
  263.  
  264.             data[o] = {
  265.                 ib = ib,
  266.                 tb = tb,
  267.                 bgb = bgb,
  268.                 db = db,
  269.                 m   = m
  270.             }
  271.         end
  272.  
  273.         local text, bg, bg_image, icon = label(o)
  274.         -- The text might be invalid, so use pcall
  275.         if not pcall(tb.set_markup, tb, text) then
  276.             tb:set_markup("<i>&lt;Invalid text&gt;</i>")
  277.         end
  278.  
  279.         bg = bg or beautiful.bg_normal -- это нужный костыль
  280.  
  281.         -- смотрим есть ли скос перед текущим тегом
  282.         -- если есть перекрашиаем его нижнюю часть
  283.         if prev_decorator then
  284.             prev_decorator:set_colors(nil, bg)
  285.         end
  286.  
  287.         if i == #objects then
  288.             -- если это последний тег, то виджет после него закрашиваем полностью
  289.             -- так как ему не с чем стыковаться
  290.             db:set_colors(bg, bg)
  291.         else
  292.             -- иначе закрашиваем только вехнюю часть виджета,
  293.             -- то есть рисуем скос
  294.             db:set_colors(bg, nil)
  295.         end
  296.  
  297.         prev_decorator = db
  298.  
  299.         bgb:set_bg(bg)
  300.         if type(bg_image) == "function" then
  301.             bg_image = bg_image(tb,o,m,objects,i)
  302.         end
  303.         bgb:set_bgimage(bg_image)
  304.         ib:set_image(icon)
  305.  
  306.         -- если это самый первый тег, то разместим перед ним
  307.         -- полностью закрашенный виджет, чтобы было симметрично с последним тегом
  308.         if i == 1 then
  309.             w:add(first_decorator)
  310.             first_decorator:set_colors(bg, bg)
  311.         end
  312.  
  313.         w:add(bgb)
  314.    end
  315. end
  316.  
  317. for s = 1, screen.count() do
  318.     -- Create a promptbox for each screen
  319.     mypromptbox[s] = awful.widget.prompt()
  320.     -- Create an imagebox widget which will contains an icon indicating which layout we're using.
  321.     -- We need one layoutbox per screen.
  322.     mylayoutbox[s] = awful.widget.layoutbox(s)
  323.     mylayoutbox[s]:buttons(awful.util.table.join(
  324.                            awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
  325.                            awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
  326.                            awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
  327.                            awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
  328.     -- Create a taglist widget
  329.     mytaglist[s] = awful.widget.taglist(
  330.         s,
  331.         awful.widget.taglist.filter.all,
  332.         mytaglist.buttons,
  333.         nil,
  334.         tag_constructor
  335.     )
  336.  
  337.     -- Create a tasklist widget
  338.     mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
  339.  
  340.     -- Create the wibox
  341.     mywibox[s] = awful.wibox({ position = "top", screen = s })
  342.  
  343.     -- Widgets that are aligned to the left
  344.     local left_layout = wibox.layout.fixed.horizontal()
  345.     left_layout:add(mylauncher)
  346.     left_layout:add(mytaglist[s])
  347.     left_layout:add(mypromptbox[s])
  348.  
  349.     -- Widgets that are aligned to the right
  350.     local right_layout = wibox.layout.fixed.horizontal()
  351.     if s == 1 then right_layout:add(wibox.widget.systray()) end
  352.     right_layout:add(mytextclock)
  353.     right_layout:add(mylayoutbox[s])
  354.  
  355.     -- Now bring it all together (with the tasklist in the middle)
  356.     local layout = wibox.layout.align.horizontal()
  357.     layout:set_left(left_layout)
  358.     layout:set_middle(mytasklist[s])
  359.     layout:set_right(right_layout)
  360.  
  361.     mywibox[s]:set_widget(layout)
  362. end
  363. -- }}}
  364.  
  365. -- {{{ Mouse bindings
  366. root.buttons(awful.util.table.join(
  367.     awful.button({ }, 3, function () mymainmenu:toggle() end),
  368.     awful.button({ }, 4, awful.tag.viewnext),
  369.     awful.button({ }, 5, awful.tag.viewprev)
  370. ))
  371. -- }}}
  372.  
  373. -- {{{ Key bindings
  374. globalkeys = awful.util.table.join(
  375.     awful.key({ modkey,           }, "Left",   awful.tag.viewprev       ),
  376.     awful.key({ modkey,           }, "Right",  awful.tag.viewnext       ),
  377.     awful.key({ modkey,           }, "Escape", awful.tag.history.restore),
  378.  
  379.     awful.key({ modkey,           }, "j",
  380.         function ()
  381.             awful.client.focus.byidx( 1)
  382.             if client.focus then client.focus:raise() end
  383.         end),
  384.     awful.key({ modkey,           }, "k",
  385.         function ()
  386.             awful.client.focus.byidx(-1)
  387.             if client.focus then client.focus:raise() end
  388.         end),
  389.     awful.key({ modkey,           }, "w", function () mymainmenu:show() end),
  390.  
  391.     -- Layout manipulation
  392.     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end),
  393.     awful.key({ modkey, "Shift"   }, "k", function () awful.client.swap.byidx( -1)    end),
  394.     awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
  395.     awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
  396.     awful.key({ modkey,           }, "u", awful.client.urgent.jumpto),
  397.     awful.key({ modkey,           }, "Tab",
  398.         function ()
  399.             awful.client.focus.history.previous()
  400.             if client.focus then
  401.                 client.focus:raise()
  402.             end
  403.         end),
  404.  
  405.     -- Standard program
  406.     awful.key({ modkey,           }, "Return", function () awful.util.spawn(terminal) end),
  407.     awful.key({ modkey, "Control" }, "r", awesome.restart),
  408.     awful.key({ modkey, "Shift"   }, "q", awesome.quit),
  409.  
  410.     awful.key({ modkey,           }, "l",     function () awful.tag.incmwfact( 0.05)    end),
  411.     awful.key({ modkey,           }, "h",     function () awful.tag.incmwfact(-0.05)    end),
  412.     awful.key({ modkey, "Shift"   }, "h",     function () awful.tag.incnmaster( 1)      end),
  413.     awful.key({ modkey, "Shift"   }, "l",     function () awful.tag.incnmaster(-1)      end),
  414.     awful.key({ modkey, "Control" }, "h",     function () awful.tag.incncol( 1)         end),
  415.     awful.key({ modkey, "Control" }, "l",     function () awful.tag.incncol(-1)         end),
  416.     awful.key({ modkey,           }, "space", function () awful.layout.inc(layouts,  1) end),
  417.     awful.key({ modkey, "Shift"   }, "space", function () awful.layout.inc(layouts, -1) end),
  418.  
  419.     awful.key({ modkey, "Control" }, "n", awful.client.restore),
  420.  
  421.     -- Prompt
  422.     awful.key({ modkey },            "r",     function () mypromptbox[mouse.screen]:run() end),
  423.  
  424.     awful.key({ modkey }, "x",
  425.               function ()
  426.                   awful.prompt.run({ prompt = "Run Lua code: " },
  427.                   mypromptbox[mouse.screen].widget,
  428.                   awful.util.eval, nil,
  429.                   awful.util.getdir("cache") .. "/history_eval")
  430.               end),
  431.     -- Menubar
  432.     awful.key({ modkey }, "p", function() menubar.show() end)
  433. )
  434.  
  435. clientkeys = awful.util.table.join(
  436.     awful.key({ modkey,           }, "f",      function (c) c.fullscreen = not c.fullscreen  end),
  437.     awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
  438.     awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ),
  439.     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
  440.     awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
  441.     awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end),
  442.     awful.key({ modkey,           }, "n",
  443.         function (c)
  444.             -- The client currently has the input focus, so it cannot be
  445.             -- minimized, since minimized clients can't have the focus.
  446.             c.minimized = true
  447.         end),
  448.     awful.key({ modkey,           }, "m",
  449.         function (c)
  450.             c.maximized_horizontal = not c.maximized_horizontal
  451.             c.maximized_vertical   = not c.maximized_vertical
  452.         end)
  453. )
  454.  
  455. -- Bind all key numbers to tags.
  456. -- Be careful: we use keycodes to make it works on any keyboard layout.
  457. -- This should map on the top row of your keyboard, usually 1 to 9.
  458. for i = 1, 9 do
  459.     globalkeys = awful.util.table.join(globalkeys,
  460.         -- View tag only.
  461.         awful.key({ modkey }, "#" .. i + 9,
  462.                   function ()
  463.                         local screen = mouse.screen
  464.                         local tag = awful.tag.gettags(screen)[i]
  465.                         if tag then
  466.                            awful.tag.viewonly(tag)
  467.                         end
  468.                   end),
  469.         -- Toggle tag.
  470.         awful.key({ modkey, "Control" }, "#" .. i + 9,
  471.                   function ()
  472.                       local screen = mouse.screen
  473.                       local tag = awful.tag.gettags(screen)[i]
  474.                       if tag then
  475.                          awful.tag.viewtoggle(tag)
  476.                       end
  477.                   end),
  478.         -- Move client to tag.
  479.         awful.key({ modkey, "Shift" }, "#" .. i + 9,
  480.                   function ()
  481.                       if client.focus then
  482.                           local tag = awful.tag.gettags(client.focus.screen)[i]
  483.                           if tag then
  484.                               awful.client.movetotag(tag)
  485.                           end
  486.                      end
  487.                   end),
  488.         -- Toggle tag.
  489.         awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
  490.                   function ()
  491.                       if client.focus then
  492.                           local tag = awful.tag.gettags(client.focus.screen)[i]
  493.                           if tag then
  494.                               awful.client.toggletag(tag)
  495.                           end
  496.                       end
  497.                   end))
  498. end
  499.  
  500. clientbuttons = awful.util.table.join(
  501.     awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
  502.     awful.button({ modkey }, 1, awful.mouse.client.move),
  503.     awful.button({ modkey }, 3, awful.mouse.client.resize))
  504.  
  505. -- Set keys
  506. root.keys(globalkeys)
  507. -- }}}
  508.  
  509. -- {{{ Rules
  510. -- Rules to apply to new clients (through the "manage" signal).
  511. awful.rules.rules = {
  512.     -- All clients will match this rule.
  513.     { rule = { },
  514.       properties = { border_width = beautiful.border_width,
  515.                      border_color = beautiful.border_normal,
  516.                      focus = awful.client.focus.filter,
  517.                      raise = true,
  518.                      keys = clientkeys,
  519.                      buttons = clientbuttons } },
  520.     { rule = { class = "MPlayer" },
  521.       properties = { floating = true } },
  522.     { rule = { class = "pinentry" },
  523.       properties = { floating = true } },
  524.     { rule = { class = "gimp" },
  525.       properties = { floating = true } },
  526.     -- Set Firefox to always map on tags number 2 of screen 1.
  527.     -- { rule = { class = "Firefox" },
  528.     --   properties = { tag = tags[1][2] } },
  529. }
  530. -- }}}
  531.  
  532. -- {{{ Signals
  533. -- Signal function to execute when a new client appears.
  534. client.connect_signal("manage", function (c, startup)
  535.     -- Enable sloppy focus
  536.     c:connect_signal("mouse::enter", function(c)
  537.         if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
  538.             and awful.client.focus.filter(c) then
  539.             client.focus = c
  540.         end
  541.     end)
  542.  
  543.     if not startup then
  544.         -- Set the windows at the slave,
  545.         -- i.e. put it at the end of others instead of setting it master.
  546.         -- awful.client.setslave(c)
  547.  
  548.         -- Put windows in a smart way, only if they does not set an initial position.
  549.         if not c.size_hints.user_position and not c.size_hints.program_position then
  550.             awful.placement.no_overlap(c)
  551.             awful.placement.no_offscreen(c)
  552.         end
  553.     end
  554.  
  555.     local titlebars_enabled = false
  556.     if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
  557.         -- buttons for the titlebar
  558.         local buttons = awful.util.table.join(
  559.                 awful.button({ }, 1, function()
  560.                     client.focus = c
  561.                     c:raise()
  562.                     awful.mouse.client.move(c)
  563.                 end),
  564.                 awful.button({ }, 3, function()
  565.                     client.focus = c
  566.                     c:raise()
  567.                     awful.mouse.client.resize(c)
  568.                 end)
  569.                 )
  570.  
  571.         -- Widgets that are aligned to the left
  572.         local left_layout = wibox.layout.fixed.horizontal()
  573.         left_layout:add(awful.titlebar.widget.iconwidget(c))
  574.         left_layout:buttons(buttons)
  575.  
  576.         -- Widgets that are aligned to the right
  577.         local right_layout = wibox.layout.fixed.horizontal()
  578.         right_layout:add(awful.titlebar.widget.floatingbutton(c))
  579.         right_layout:add(awful.titlebar.widget.maximizedbutton(c))
  580.         right_layout:add(awful.titlebar.widget.stickybutton(c))
  581.         right_layout:add(awful.titlebar.widget.ontopbutton(c))
  582.         right_layout:add(awful.titlebar.widget.closebutton(c))
  583.  
  584.         -- The title goes in the middle
  585.         local middle_layout = wibox.layout.flex.horizontal()
  586.         local title = awful.titlebar.widget.titlewidget(c)
  587.         title:set_align("center")
  588.         middle_layout:add(title)
  589.         middle_layout:buttons(buttons)
  590.  
  591.         -- Now bring it all together
  592.         local layout = wibox.layout.align.horizontal()
  593.         layout:set_left(left_layout)
  594.         layout:set_right(right_layout)
  595.         layout:set_middle(middle_layout)
  596.  
  597.         awful.titlebar(c):set_widget(layout)
  598.     end
  599. end)
  600.  
  601. client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
  602. client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
  603. -- }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement