rc.lua: Use the buttons property instead of method for the tag/tasklist

Begin to bring consistency to these ancient components.
This commit is contained in:
Emmanuel Lepage Vallee 2018-12-26 21:21:49 -05:00
parent 82db9180b1
commit 56b242906d
1 changed files with 38 additions and 37 deletions

View File

@ -104,45 +104,46 @@ mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it -- Create a wibox for each screen and add it
-- @TAGLIST_BUTTON@ -- @TAGLIST_BUTTON@
local taglist_buttons = gears.table.join( local taglist_buttons = {
awful.button({ }, 1, function(t) t:view_only() end), awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t) awful.button({ modkey }, 1, function(t)
if client.focus then if client.focus then
client.focus:move_to_tag(t) client.focus:move_to_tag(t)
end end
end), end),
awful.button({ }, 3, awful.tag.viewtoggle), awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t) awful.button({ modkey }, 3, function(t)
if client.focus then if client.focus then
client.focus:toggle_tag(t) client.focus:toggle_tag(t)
end end
end), end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end),
) }
-- @TASKLIST_BUTTON@ -- @TASKLIST_BUTTON@
local tasklist_buttons = gears.table.join( local tasklist_buttons = {
awful.button({ }, 1, function (c) awful.button({ }, 1, function (c)
if c == client.focus then if c == client.focus then
c.minimized = true c.minimized = true
else else
c:emit_signal( c:emit_signal(
"request::activate", "request::activate",
"tasklist", "tasklist",
{raise = true} {raise = true}
) )
end end
end), end),
awful.button({ }, 3, function() awful.button({ }, 3, function()
awful.menu.client_list({ theme = { width = 250 } }) awful.menu.client_list({ theme = { width = 250 } })
end), end),
awful.button({ }, 4, function () awful.button({ }, 4, function ()
awful.client.focus.byidx(1) awful.client.focus.byidx(1)
end), end),
awful.button({ }, 5, function () awful.button({ }, 5, function ()
awful.client.focus.byidx(-1) awful.client.focus.byidx(-1)
end)) end),
}
-- @DOC_WALLPAPER@ -- @DOC_WALLPAPER@
screen.connect_signal("request::wallpaper", function(s) screen.connect_signal("request::wallpaper", function(s)