Hi,
due to using awesome on different computers I want to externalize some
widgets into another file, because I have to edit their code in the
rc.lua when porting the configuration file to another machine due to a
smaller screen size. So I want to externalize them to have a file with
width-adapted widgets for each machine.

Unfortunately I haven't found any explanation or example, so I hope
someone here can help me.

What I tried:

I created a file named "widgetfile.lua", which contains:
> local awful = require("awful")
> local vicious = vicious
> local widget = widget
> module("widgetfile")
>
> function makecpuw()
>     cputxt = widget({type = "textbox"})
>     vicious.register(cputxt, vicious.widgets.cpu, '<span
color="#9393cc">CPU: $1%</span>', 1)
>     return cputxt
>end

The relevant part of the rc.lua contains (originally the first two lines
of the makecpuw-function were located at this point (and it worked well)):
> cputxt = widgetfile.makecpuw

And a "require("widgetfile")" at the end of the "require"-block.

I would be glad if someone could help me getting this to work (or reveal
to me that it is technically impossible, which I do not hope).

Thanks in advance!
Manuel

-- 
To unsubscribe, send mail to [email protected].

Reply via email to