Here is another one,

It got pretty annoying today evening when playing around with menus
when I had to restart awesome after adding the damned {keygrabber =
true} every time.  Most of the time, it is just redundant.  I don't
see why would anyone want keyboard navigation turned off by default.
I mean, people take navigating menus from keyboard for granted,
courtsey whatever window manager or desktop environment they had been
using before, right?  Hence the patch.  What do you think?

-- 
Anurag Priyam
From 0ea140f0031d9105f5144f3f098a8670578ed59e Mon Sep 17 00:00:00 2001
From: Anurag Priyam <[email protected]>
Date: Tue, 21 Feb 2012 21:52:53 +0530
Subject: [PATCH] awful.menu: enable keyboard navigation by default

Signed-off-by: Anurag Priyam <[email protected]>
---
 awesomerc.lua.in      |    2 +-
 lib/awful/menu.lua.in |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/awesomerc.lua.in b/awesomerc.lua.in
index 3929d9f..ceac430 100644
--- a/awesomerc.lua.in
+++ b/awesomerc.lua.in
@@ -210,7 +210,7 @@ globalkeys = awful.util.table.join(
             awful.client.focus.byidx(-1)
             if client.focus then client.focus:raise() end
         end),
-    awful.key({ modkey,           }, "w", function () mymainmenu:show({keygrabber=true}) end),
+    awful.key({ modkey,           }, "w", function () mymainmenu:show() end),
 
     -- Layout manipulation
     awful.key({ modkey, "Shift"   }, "j", function () awful.client.swap.byidx(  1)    end),
diff --git a/lib/awful/menu.lua.in b/lib/awful/menu.lua.in
index 3e8566f..64f8ae8 100644
--- a/lib/awful/menu.lua.in
+++ b/lib/awful/menu.lua.in
@@ -317,12 +317,13 @@ end
 --- Show a menu.
 -- @param menu The menu to show.
 -- @param args.keygrabber A boolean enabling or not the keyboard navigation.
+-- Default is true.
 -- @param args.coords Menu position defaulting to mouse.coords()
 function show(menu, args)
     args = args or {}
     local coords = args.coords or nil
     local screen_index = capi.mouse.screen
-    local keygrabber = args.keygrabber or false
+    local keygrabber = args.keygrabber or true
 
     if not set_size(menu) then return end
     set_coords(menu, screen_index, coords)
@@ -367,6 +368,7 @@ end
 --- Toggle menu visibility.
 -- @param menu The menu to show if it's hidden, or to hide if it's shown.
 -- @param args.keygrabber A boolean enabling or not the keyboard navigation.
+-- Default is true.
 -- @param args.coords Menu position {x,y}
 function toggle(menu, args)
     if menu.wibox.visible then
@@ -489,6 +491,7 @@ end
 --- Build a popup menu with running clients and shows it.
 -- @param menu Menu table, see new() function for more informations
 -- @param args.keygrabber A boolean enabling or not the keyboard navigation.
+-- Default is true.
 -- @return The menu.
 function clients(menu, args) -- FIXME crude api
     menu = menu or {}
-- 
1.7.9

Reply via email to