On 4 March 2012 00:57, Vitor Eiji Justus Sakaguti <vitorei...@gmail.com>wrote:
> On Sun, Mar 4, 2012 at 12:23 AM, Satoshi Hayazaki > <heavennevertouchedearthlyf...@gmail.com> wrote: > > Hey, guys, I've been wondering if I could set awesome so that when I > middle > > click the taskbar the corresponding app would be closed. > > > > Unfortunately I have zero knowledge about Lua to try and whip something > up > > on my own :( > > Hi Satoshi, this is a nice idea! > In your rc.lua you should have a mytasklist.buttons variable, where > you define what the tasklist will do when you click on it with any > given button. The middle button's number is 2, so you should add > something like this: > ---------------------------------------------------------- > awful.button({ }, 2, function (c) > c:kill() > end), > ---------------------------------------------------------- > > Here's how mine looks like (with this implemented): > ---------------------------------------------------------- > 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({ }, 2, function (c) > c:kill() > 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)) > ---------------------------------------------------------- > > HTH, > Vitor > Wow, thanks a lot, it works perfectly.