Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 07-15-2019, 07:19 AM   #1
sladflob
Enthusiast
sladflob began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Feb 2013
Device: Kobo Touch, Aura One
Percentage read in screensaver text

Hi everyone,

This is one feature I miss from the stock Kobo firmware, the ability to see the percentage read on the screen while the device is asleep. I know I can see the book status but it's not quite the same.

Anyway, I did a bit of digging and managed to modify screensaver.lua so that it appends the string " (93% read)" to the default screensaver text if screensaver_message is not set, and it works pretty well. It's a bit of a hack as you have to edit settings.reader.lua and delete the screensaver_message entry but it works as a proof of concept.

I'm just wondering if the powers that be think that this might be something worth adding in more properly? Maybe as a checkbox in the settings dialog? Or else maybe have a special identifier (like %p) that you can put in your screensaver text that gets substituted with progress percentage? I'm quite happy to poke around a bit more and have a go at it myself but I don't really know what the process is and don't want to tread on anyone's toes.

Cheers,

james
sladflob is offline   Reply With Quote
Old 07-15-2019, 11:20 AM   #2
Frenzie
Guru
Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.
 
Posts: 707
Karma: 133278
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
There is already some functionality to set a custom screensaver message. Like you said you could extend that with a few optional variables.

See https://github.com/koreader/koreader...nsaver.lua#L68 for an example of how that works.

Sticking "(93% read)" in the default message should be fine too.

Basically you make your changes and open a PR to get them included in the code, or if you want to discuss it before opening a PR you can post diffs in an issue or here on the forum.
Frenzie is online now   Reply With Quote
Old 07-17-2019, 12:19 AM   #3
sladflob
Enthusiast
sladflob began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Feb 2013
Device: Kobo Touch, Aura One
OK great, thanks!

I looked into using %p in the text as an identifier for percentage only to find that the inbuilt keyboard doesn't have a % character! So I made it @p instead. While I was at it I added @c and @t for current and total pages respectively. Seems to work quite well. I was wondering if I should add anything else, like title, author etc, that people might want to put in their sleep message?

I tried creating a pull-request but not sure if I have permission? Or do I need to make a branch? Sorry if these are basic questions... I am a developer but a bit old-school in that I've mostly used SVN before so this is a good exercise for me to learn github etc.

Cheers.
sladflob is offline   Reply With Quote
Old 07-17-2019, 02:29 PM   #4
Frenzie
Guru
Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.Frenzie puts his or her pants on both legs at a time.
 
Posts: 707
Karma: 133278
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
You have to create a "fork" using the link in the top right corner on GitHub. Then in your fork you could edit master or work in a branch. Working in branches is better but for starters it doesn't matter. (And it never really matters to anyone other than yourself in any case.)

Also see https://reflectoring.io/github-fork-and-pull/ (random page I just found; looks okay) and http://koreader.rocks/doc/topics/Collaborating.html

Quote:
the inbuilt keyboard doesn't have a % character!
There is, under symbols with shift active.

I meant to use the existing template function (i.e., with %1, %2, etc.) but let's first await the PR.
Frenzie is online now   Reply With Quote
Old 07-17-2019, 09:40 PM   #5
sladflob
Enthusiast
sladflob began at the beginning.
 
Posts: 30
Karma: 10
Join Date: Feb 2013
Device: Kobo Touch, Aura One
Quote:
Originally Posted by Frenzie View Post
There is, under symbols with shift active.
Cripes, don't know how I missed that... ok, have changed my code to use % instead of @.

Quote:
I meant to use the existing template function (i.e., with %1, %2, etc.) but let's first await the PR.
Right, it's done, #5121.

Thanks for all the help! It's making a lot more sense now.
sladflob is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing the Percentage Read deucalion0 Kobo Developer's Corner 4 03-31-2017 08:15 PM
Percentage of Book Read BenG Marvin 8 04-09-2014 03:50 PM
Percentage read in Android app faithbw Kobo Reader 3 09-14-2013 09:21 AM
Percentage Read ParadiseLost Calibre 1 04-07-2013 11:24 PM
Percentage read not displayed for book cottonball Kindle Fire 6 12-16-2011 10:43 AM


All times are GMT -4. The time now is 03:25 PM.


MobileRead.com is a privately owned, operated and funded community.