Hi,
I have some questions on scripting in lua. Please don't
laugh if you read something silly. I am no coder. I am
only a Ion addict who wants to customize something...
Problem:
There is a statusd called statusd_volume.lua. It shows the volume
of the master volume in percent. The only drawback of this statusd
is that you have to wait until the update function updates the value
of the volume in the statusbar. Setting the interval to 1 second can't
be the solution.
What i thought of was to disable the update timer of this statusd and
simply call the update function manually every time with my binding
for raise/lower/mute volume.
My questions:
How can i archieve this?
Is it right that i have to use dopath("statusd_volume")
to make the functions of statusd_volume accessable from
outside?
Do i need to remove the "local" keyword in front of all
functions of statusd_volume.lua and change the function names so
that they are absolutely unique (collison with existing function
names) or remove only the one of the update_volume function ?
How can i call functions from a statusd?
The problem is that i don't know how a statusd like statusd_volume
is known by Ion.
Example from statusd_volume.lua (volume_timer disabled)
local function inform(key, value)
statusd.inform("volume_"..key, value)
end
local function update_volume()
local master, pcm = get_volume()
inform("master", master)
inform("pcm", pcm)
-- update every 10 seconds
-- volume_timer:set(5*1000, update_volume)
end
I get "attempt to index global `statusd' (a nil value)"
when i put dopath in cfg_ion.lua.
The error occurs where internal functions of Ion are used.
statusd.inform("volume_"..key, value)
And my last question:
How can i access these functions then in cfg_bindings?
Thanks a lot for help and patience,
Heiko