Hi there :)

To Hell, you must help me here :(

I wrote an mpc.lua:

-----------------------------
function mpc_status_osd()

os.execute("mpc | osd_cat -u red -s 2 -p middle -A left -o 30 -f \
'-b&h-lucida-bold-r-normal-*-*-240-*-*-p-*-*-*' -c rgb:ff/00/00 -d 2")
-----------------------------

Which I inluded in ion.lua and the end by 

include("mpc")

I am trying to call it out of ion-bindings.lua:

   kpress(SECOND_MOD.."F10", make_exec_fn("mpc pause")),
--   kpress(SECOND_MOD.."F10", mpc_status_osd()),
   kpress(SECOND_MOD.."F11", make_exec_fn("mpc prev")),
   kpress(SECOND_MOD.."F12", make_exec_fn("mpc next")),

But ion2 thinks, its an global function (when -- removed):

Ion startup error log:
>> /home/konsti/.ion2/ion-bindings.lua:112: attempt to call global
>> `mpc_status_osd' (a nil value)
>> Some bindmaps were empty, loading ioncore-efbb
>> The binding group(s) mplex_bindings
   were empty so the following emergency mappings have been made:
   Mod1+C -> WRegion.close_sub_or_self
   Please fix your configuration files!
>> Stack trace:
   0 [C]: in 'warn'
   1 ioncore-efbb.lua:45
     [Skipping unnamed C functions.]

I read the function lua wiki howto and many other stuff too and I am
firm in perl and c kernel programming. But lua looks really strange
to me, and I don't get it :/

When executing lua code (kpress(SECOND_MOD.."F3",
querylib.query_lua),)
the osd appears as expected, so the funktion seems to be included...
How do I call it?
Another thing is:

When pressing SECOND_MOD.."F10" I want to execute the "mpc blorgh"
and after that the mpc_osd_status function, how do I achieve this?

Regards, Konsti

-- 
2.6.5-mm1
Konstantin Kletschke <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
GPG KeyID EF62FCEF
Fingerprint: 13C9 B16B 9844 EC15 CC2E  A080 1E69 3FDA EF62 FCEF
keulator.homelinux.org up 43 min, 1

Reply via email to