Hi,

> By default, they are value matched. You can easily change the comparing
> function in the manage hook easily to use :match() instead of == for
> value comparison to use regexes though.
Ok, i'll dig to find the kook :-)

Sorry if i bother you with a number of questions that comes near the primes,
but in my widget creation experiment i met another issue (maybe it's a bit
off-topic, so you could flame completely ;-): i build a "volume
widget" to begin
my trial with awesome and lua, and build a function (that's benn hooked) to
update my textbox and display volume values (left and right channels); to
gain the values i fire up with io.popen():

function asVolume_widget_update(...)
 [...]
 local status = io.popen("amixer -c 0 sget Master"):read("*all")
 status = string.match(status, "%[(o[nf]f?)%]")
 [...]
end

This to extract the status and see if the card is mute or unmute, but it's just
an example... In other functions i have other io.popen() calls.
The hook runs every 5 seconds, but after ~20 minutes i run out of pipes and
awesome seems to be half-hanged and lsof shows a lot of pipes open from
awesome... So i write a "wrapper" to io.popen() like that to read a command
output:

function asVolume_popen(string)
 assert(string ~= "")

 local fh = io.popen(string, "r")
 local o = fh:read("*all")
 fh:close()

 return o
end

Of course replacing as:

local status = asVolume_popen("amixer -c 0 sget Master")

Now, the problem seems to be solved, but my question is... No, my two question
is:

* does my stupid brain use io.popen() in the wrong way?
* or does io.popen(...):read("*all") leaves pipes open?

If last one is true what is the filehandle of pipe in the form:

output = io.popen(<COMMAND>):read("*all")

?

Thanks to all.
ff0000

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

Reply via email to