]> git.rmz.io Git - dotfiles.git/commitdiff
awesome: update topbar.lua
authorSamir Benmendil <me@rmz.io>
Mon, 13 Mar 2017 00:12:05 +0000 (00:12 +0000)
committerSamir Benmendil <me@rmz.io>
Mon, 13 Mar 2017 00:12:05 +0000 (00:12 +0000)
awesome/topbar.lua

index 938e7ed59673273b8396276f8d8e080b9c2c715f..27493b3f7534e5c614e3d73e58e7abb6d236eb60 100644 (file)
@@ -8,6 +8,19 @@ local wibox = require("wibox")
 separator = wibox.widget.textbox()
 separator:set_markup('<span font="Symbola 10" color="#404040">│</span>')
 
+local function client_menu_toggle_fn()
+    local instance = nil
+
+    return function ()
+        if instance and instance.wibox.visible then
+            instance:hide()
+            instance = nil
+        else
+            instance = awful.menu.clients({ theme = { width = 250 } })
+        end
+    end
+end
+
 -- Wibox {{{1
 -- Create a wibox for each screen and add it
 local taglist_buttons = awful.util.table.join(
@@ -45,14 +58,7 @@ local tasklist_buttons = awful.util.table.join(
                                               end
                                           end),
                      awful.button({ }, 2, function (c) c:kill() end),
-                     awful.button({ }, 3, function ()
-                                            if instance and instance.wibox.visible then
-                                                instance:hide()
-                                                instance = nil
-                                            else
-                                                instance = awful.menu.clients({ theme = { width=250 }})
-                                            end
-                                          end),
+                     awful.button({ }, 3, client_menu_toggle_fn()),
                      awful.button({ }, 4, function ()
                                               awful.client.focus.byidx(1)
                                           end),
@@ -68,10 +74,10 @@ awful.screen.connect_for_each_screen(function(s)
     -- We need one layoutbox per screen.
     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)))
+                           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(s, awful.widget.taglist.filter.all, taglist_buttons)
 
@@ -86,7 +92,6 @@ awful.screen.connect_for_each_screen(function(s)
         layout = wibox.layout.align.horizontal,
         { -- Left widgets
             layout = wibox.layout.fixed.horizontal,
-            -- mylauncher,
             s.mytaglist,
             s.mypromptbox,
         },