-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 10/05/12 16:49, Rainer M Krug wrote: > On 10/05/12 16:35, Gwenhael Le Moine wrote: >> 2012/5/10 Rainer M Krug <[email protected]>: >>> If I put the section: >>> >>> - -- {{{ Mouse bindings root.buttons(awful.util.table.join( awful.button({ >>> }, 3, function >>> () mymainmenu:toggle() end), awful.button({ }, 4, awful.tag.viewnext), >>> awful.button({ }, >>> 5, awful.tag.viewprev) )) - -- }}} >>> >>> into the file mousebindings.lua and replace it in rc.lua with >>> >>> >>> dopath("./mousebindings.lua") >>> >>> rc.lua does not work anymore. >>> >>> What am I missing? > >> I haven't touched lua or my rc.lua in a long time but I'd hazard a guess >> that you're missing >> the appropriate require in the mousebindings.lua If you look at >> https://github.com/ierton/awesomerc-ierton/blob/laptop/myrc/keybind.lua for >> example the >> following lines provide the necessary modules for the code to work : > >> local awful = require("awful") local naughty = require("naughty") local >> mouse = mouse > >> local capi = { root = root, } > >> local table = table local ipairs = ipairs local tostring = tostring > >> That's the direction I'd look anyway. > > I think I understand the problem now: When I use dopath(mousebindings.lua) in > rc.lua, the file > is actually executed as it is, in the context and environment of > mousebindings.lua - correct? > > What I was thinking of is kind of an "include", where the code in the file is > inserted and > executed in the context of rc.lua. > > Am I right here?
Just ignore this post - it is working now. Cheers, Rainer > > Rainer > > >> Gwenhael > > > > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+swHcACgkQoYgNqgF2egpH5wCdHGgUhGnFA9Ab24E+k8eK14UD +VEAnRS0YzJHKB8u/QU1WGnjN0MTO+ts =2lK5 -----END PGP SIGNATURE----- -- To unsubscribe, send mail to [email protected].
