From 3dda0e3e9932939035da22fd1a9c78c9820b1581 Mon Sep 17 00:00:00 2001 From: Alexandre Viau Date: Sun, 11 May 2014 17:27:50 -0400 Subject: [PATCH] Moved tag bindings to settings/binds.lua --- rc.lua.blackburn | 39 +-------------------------------------- rc.lua.copland | 39 +-------------------------------------- rc.lua.dremora | 39 +-------------------------------------- rc.lua.holo | 39 +-------------------------------------- rc.lua.multicolor | 39 +-------------------------------------- rc.lua.powerarrow-darker | 39 +-------------------------------------- rc.lua.rainbow | 39 +-------------------------------------- rc.lua.steamburn | 39 +-------------------------------------- settings/binds.lua | 37 +++++++++++++++++++++++++++++++++++++ 9 files changed, 45 insertions(+), 304 deletions(-) diff --git a/rc.lua.blackburn b/rc.lua.blackburn index d348fdd..271a526 100644 --- a/rc.lua.blackburn +++ b/rc.lua.blackburn @@ -293,7 +293,7 @@ end require("settings.binds") -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = awful.util.table.join(globalkeys, -- Take a screenshot -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end), @@ -476,43 +476,6 @@ clientkeys = awful.util.table.join( end) ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewonly(tag) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewtoggle(tag) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.movetotag(tag) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.toggletag(tag) - end - end)) -end - clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), diff --git a/rc.lua.copland b/rc.lua.copland index 7e38a0c..43c13ff 100644 --- a/rc.lua.copland +++ b/rc.lua.copland @@ -343,7 +343,7 @@ end require("settings.binds") -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = awful.util.table.join(globalkeys, -- Take a screenshot -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end), @@ -530,43 +530,6 @@ clientkeys = awful.util.table.join( end) ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewonly(tag) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewtoggle(tag) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.movetotag(tag) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.toggletag(tag) - end - end)) -end - clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), diff --git a/rc.lua.dremora b/rc.lua.dremora index 912ee99..e3089cb 100644 --- a/rc.lua.dremora +++ b/rc.lua.dremora @@ -293,7 +293,7 @@ end require("settings.binds") -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = awful.util.table.join(globalkeys, -- Take a screenshot -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end), @@ -476,43 +476,6 @@ clientkeys = awful.util.table.join( end) ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewonly(tag) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewtoggle(tag) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.movetotag(tag) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.toggletag(tag) - end - end)) -end - clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), diff --git a/rc.lua.holo b/rc.lua.holo index cdfe937..ad8415d 100644 --- a/rc.lua.holo +++ b/rc.lua.holo @@ -428,7 +428,7 @@ end require("settings.binds") -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = awful.util.table.join(globalkeys, -- Take a screenshot -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end), @@ -611,43 +611,6 @@ clientkeys = awful.util.table.join( end) ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewonly(tag) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewtoggle(tag) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.movetotag(tag) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.toggletag(tag) - end - end)) -end - clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), diff --git a/rc.lua.multicolor b/rc.lua.multicolor index b74d3b9..b8c33e0 100644 --- a/rc.lua.multicolor +++ b/rc.lua.multicolor @@ -360,7 +360,7 @@ end require("settings.binds") -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = awful.util.table.join(globalkeys, -- Take a screenshot -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end), @@ -540,43 +540,6 @@ clientkeys = awful.util.table.join( end) ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewonly(tag) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewtoggle(tag) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.movetotag(tag) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.toggletag(tag) - end - end)) -end - clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), diff --git a/rc.lua.powerarrow-darker b/rc.lua.powerarrow-darker index 4bae2f2..2973f38 100644 --- a/rc.lua.powerarrow-darker +++ b/rc.lua.powerarrow-darker @@ -351,7 +351,7 @@ end require("settings.binds") -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = awful.util.table.join(globalkeys, -- Take a screenshot -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end), @@ -529,43 +529,6 @@ clientkeys = awful.util.table.join( end) ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewonly(tag) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewtoggle(tag) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.movetotag(tag) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.toggletag(tag) - end - end)) -end - clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), diff --git a/rc.lua.rainbow b/rc.lua.rainbow index 32bb946..aa40040 100644 --- a/rc.lua.rainbow +++ b/rc.lua.rainbow @@ -291,7 +291,7 @@ end require("settings.binds") -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = awful.util.table.join(globalkeys, -- Take a screenshot -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end), @@ -474,43 +474,6 @@ clientkeys = awful.util.table.join( end) ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewonly(tag) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewtoggle(tag) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.movetotag(tag) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.toggletag(tag) - end - end)) -end - clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), diff --git a/rc.lua.steamburn b/rc.lua.steamburn index 691d341..cb4123e 100644 --- a/rc.lua.steamburn +++ b/rc.lua.steamburn @@ -304,7 +304,7 @@ end require("settings.binds") -- {{{ Key bindings -globalkeys = awful.util.table.join( +globalkeys = awful.util.table.join(globalkeys, -- Take a screenshot -- https://github.com/copycat-killer/dots/blob/master/bin/screenshot awful.key({ altkey }, "p", function() os.execute("screenshot") end), @@ -483,43 +483,6 @@ clientkeys = awful.util.table.join( end) ) --- Bind all key numbers to tags. --- Be careful: we use keycodes to make it works on any keyboard layout. --- This should map on the top row of your keyboard, usually 1 to 9. -for i = 1, 9 do - globalkeys = awful.util.table.join(globalkeys, - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewonly(tag) - end - end), - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = mouse.screen - local tag = awful.tag.gettags(screen)[i] - if tag then - awful.tag.viewtoggle(tag) - end - end), - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.movetotag(tag) - end - end), - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - local tag = awful.tag.gettags(client.focus.screen)[i] - if client.focus and tag then - awful.client.toggletag(tag) - end - end)) -end - clientbuttons = awful.util.table.join( awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ modkey }, 1, awful.mouse.client.move), diff --git a/settings/binds.lua b/settings/binds.lua index daa552b..a19b040 100644 --- a/settings/binds.lua +++ b/settings/binds.lua @@ -7,3 +7,40 @@ root.buttons(awful.util.table.join( awful.button({ }, 5, awful.tag.viewprev) )) -- }}} + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it works on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + globalkeys = awful.util.table.join(globalkeys, + awful.key({ modkey }, "#" .. i + 9, + function () + local screen = mouse.screen + local tag = awful.tag.gettags(screen)[i] + if tag then + awful.tag.viewonly(tag) + end + end), + awful.key({ modkey, "Control" }, "#" .. i + 9, + function () + local screen = mouse.screen + local tag = awful.tag.gettags(screen)[i] + if tag then + awful.tag.viewtoggle(tag) + end + end), + awful.key({ modkey, "Shift" }, "#" .. i + 9, + function () + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.movetotag(tag) + end + end), + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, + function () + local tag = awful.tag.gettags(client.focus.screen)[i] + if client.focus and tag then + awful.client.toggletag(tag) + end + end)) +end