From d1aa54923941e3a55058e631d966ead6b9ed91af Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 20 Dec 2020 22:00:06 +0530 Subject: attempted to make keybindings config a bit more readable --- awesome/rc.lua | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'awesome') diff --git a/awesome/rc.lua b/awesome/rc.lua index 750d14ec..9dad702c 100755 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -246,16 +246,9 @@ root.buttons(gears.table.join( )) -- }}} --- {{{ Key bindings -globalkeys = gears.table.join( - awful.key({ modkey, }, "s", hotkeys_popup.show_help, - {description="show help", group="awesome"}), - awful.key({ "Mod1", }, "h", awful.tag.viewprev, - {description = "view previous", group = "tag"}), - awful.key({ "Mod1", }, "l", awful.tag.viewnext, - {description = "view next", group = "tag"}), - awful.key({ "Mod1", }, "Tab", awful.tag.history.restore, - {description = "go back", group = "tag"}), +-- for window navigation with hjkl +-- i.e vim movement keys +navKeys = gears.table.join( awful.key({ "Mod4" }, "j", function () awful.client.focus.bydirection("down") if client.focus then client.focus:raise() end end), @@ -267,8 +260,33 @@ globalkeys = gears.table.join( end), awful.key({ "Mod4" }, "l", function () awful.client.focus.bydirection("right") if client.focus then client.focus:raise() end - end), - + end) +) + +-- keybindings to navigate b/w monitors +-- uncomment multiMonitorNavKeys in +-- globalkeys to enable +multiMonitorNavKeys = gears.table.join( + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, + {description = "focus the next screen", group = "screen"}), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, + {description = "focus the previous screen", group = "screen"}) +) + + + +-- {{{ Key bindings +globalkeys = gears.table.join( + navKeys, + -- multiMonitorNavKeys, + awful.key({ modkey, }, "s", hotkeys_popup.show_help, + {description="show help", group="awesome"}), + awful.key({ "Mod1", }, "h", awful.tag.viewprev, + {description = "view previous", group = "tag"}), + awful.key({ "Mod1", }, "l", awful.tag.viewnext, + {description = "view next", group = "tag"}), + awful.key({ "Mod1", }, "Tab", awful.tag.history.restore, + {description = "go back", group = "tag"}), -- Layout manipulation awful.key({ "Mod4", "Shift" }, "h", function () awful.client.swap.bydirection("left") end, {description = "move client to the left", group = "client"}), @@ -283,11 +301,7 @@ globalkeys = gears.table.join( - awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, - {description = "focus the next screen", group = "screen"}), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, - {description = "focus the previous screen", group = "screen"}), - awful.key({ "Mod1", }, "u", awful.client.urgent.jumpto, + awful.key({ "Mod1", }, "u", awful.client.urgent.jumpto, {description = "jump to urgent client", group = "client"}), awful.key({ modkey, }, "Tab", function () -- cgit v1.2.3