@NiLuJe
thank you for clearing this out!
Okay, so let's leave alone Java booklet.
I am going to approach from different side:
1) I was able to find book length and its current progress in /var/local/cc.db . However, I don't know how to extract these values from shell. I read a few tutorials on sqlite, but they only allow to change values inside the database, not extract them. How can I extract them?
2) Chapters structure prorbably I can extract from mobi files themselves. This idea comes from Calibre plug-ins capability. I am thinking on something like preparation files (with chapters info) which are put next to each respective book so that the script can go and find it.
3) The only real problem for now seems to identify which book is currently open. I'll think on it after I solve first two
For now I guess I should enter them manually in the script.