Hi,
> Three questions.
> I wanted to try using a message box to display time or other system info.
> It hasn't been as simple as expected.
>
> 1. I haven't found a way to display a message.
> This is as close as I've come (as in, doesn't produce an error):
> mplex_bindings{
> kpress(DEFAULT_MOD.."I", function(s) s:query_message("hello?") end),
> }
> I've also tried to attach(the_wmessage,{etc.}) without success,
> and none of querylib.make_* seem quite right either.
>
> 2. How would I go about calling a shell script to return a string usable in the lua
> code?
I came to something like this (I'm new user of Ion):
I added those lines to my ion-bindings.lua (in global_bindings section):
---
kpress(SECOND_MOD.."F1", function(scr)
popen_bgread("/home/kamil/.ion2/mailstat.sh",
function (data)
newmail = string.sub(data,string.find(data,"%d*"))
oldmail = string.sub(data,string.find(data,"%d*")+1)
query_message(scr, os.date() .. "\nNumber of new messages: "
.. newmail .. "\nNumber of read messages: " .. oldmail)
end)
end),
---
and mailstat.sh is something like this:
---
#!/bin/bash
A=`frm -s n | wc -l | sed -e "s/ *//"`
B=`frm -s r | wc -l | sed -e "s/ *//"`
echo "$A $B"
---
But since I wanted to be informed when new mail arrives I dropped using
this (I'm using xosd now.) But as you see it is possible.
I hope it will be helpful :)
--
Best regards,
Kamil