Hello,
On 03/05/13 09:49:11 +0200, mimosinnet wrote:
> I am new in the list and I just started with awesome. I have been using
> fvwm for years, and I thought nothing could have made me ever
> considering manging window managers...., till something awesome
> appeared.
Me too... :)
<snip>
> And I have defined different menus and been able to get a personalised menu
> in each tag:
>
> >---------
>
> -- Go to tag and menu with shift and numeric pad
> -- Menus: "M_File", "M_Mail", "M_Office", "M_Fox", "M_Sys", "M_Oci",
> "M_Chrome", "M_Xarxa", "M_Awesome"
<snip>
> This more of a lua question: is it possible to simplify the above code?
> I have unsuccessfully tried to get the menu in a variable and use them
> afterwards. Or maybe am I using a wrong approach?
What about:
Menu_Table = {M_File, M_Mail, M_Office, M_Fox, M_Sys, M_Oci, M_Chrome,
M_Xarxa, M_Awesome}
-- assuming you want this, insert it somewhere in the globalkeys
-- table
awful.key({ "Mod4" }, "w",
function ()
local s = mouse.screen
local id = awful.tag.selected (s)
Menu_Table[id]:show({keygrabber=true})
end)
Does this work? If it does, then replace the mouse binding on the root
window as well.
-- Assuming you want to toggle the menu with a right click, insert
-- that into your mouse bindings table
awful.button({ }, 3,
function ()
local s = mouse.screen
local id = awful.tag.selected (s)
Menu_Table[id]:toggle({keygrabber=true})
end)
I hope it works.
Cheers,
Ignas
--
To unsubscribe, send mail to [email protected].