Am 17.10.2012 22:38, schrieb Uli Schlachter:
> Well, it would help a lot if you would tell us which error you get. Because
> your
> code looks fine to me.
Oh, sorry, I forgot, because I do not get an error at all. I just have
no CPU monitor anymore.
I made it work just by changing "cputxt = widgetfile.makecpuw" to
"cputxt = widgetfile.makecpuw()", inspired by you (probably routinely)
writing the function calls *with* brackets.
Therefore: Thanks a lot!
Do I usually call functions with brackets, but when I want to bind them
to key- or mousebinds, then I just give the name of the function and
awesome calls them itself (with brackets(?)) when triggered? Because in
the keybind-section I always place the fuction calls without brackets,
otherwise I get a crash of my configuration.
As you can see, I'm still a little bit inexperienced, sorry for the
circumstances.
However, for the purpose of experimenting and learning, I adapted the
code, the ~/.config/awesome/widgetfile.lua is now:
> function makecpuw()
> cputxt = widget({type = "textbox"})
> vicious.register(cputxt, vicious.widgets.cpu, '<span
color="#9393cc">CPU: $1%</span>', 1)
> return cputxt
> end
The rc.lua is adapted by changing "required("widgetfile")" to
"dofile("/home/me/.config/awesome/widgetfile.lua")" and the line where I
put the widget into "cputxt" to
> cputxt = makecpuw()
That's how it should be? At least, it's working this way, however, I
have to use the absolute path in the dofile-command, I can't use just
the file name nor "./filename", not even "~/.config/awesome/filename" (I
guess "~" is a thing just for the shell).
And what's the exact difference between a module/required-command and a
dofile-command? And a dofile-file is treated as being part of the rc.lua
itself?
Cheers
Manuel
--
To unsubscribe, send mail to [email protected].