Hello,

it starts to drive me a bit mad because I cann't understand what's going
wrong with the following code:

prg_out = io.popen('/usr/bin/xkb-switch'):read('*a')

When run in a separate script or from Lua interpreter it works as expected,
ie. it stores program output in prg_out variable. But run from rc.lua it
hangs forever. Function io.popen() successfully returns file handle but any
attempt to call read() or close() at this handle results in script stall :(
The same behavior when trying to catch output of other programs like xrandr,
xmodmap.

However what makes it uneasy, catching output of programs  amixer, mpc,
uname like

prg_out = io.popen('/bin/uname -r'):read('*a')

does work, ie. rc.lua script doesn't hang and output is stored.

I cann't find the source of problem. All mentioned programs are Linux ELF
executables, single or multiline output makes no difference, setting locales
to default (LANG=C LC_ALL=C) also makes no difference. And as already
stated, the issue manifests only when run from within rc.lua script.

Any idea what I may have omitted ?


David

Reply via email to