![]() |
#1 |
Connoisseur
![]() Posts: 63
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 |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,742
Karma: 730681
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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 63
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. |
![]() |
![]() |
![]() |
#4 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,742
Karma: 730681
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:
I meant to use the existing template function (i.e., with %1, %2, etc.) but let's first await the PR. ![]() |
|
![]() |
![]() |
![]() |
#5 | |
Connoisseur
![]() Posts: 63
Karma: 10
Join Date: Feb 2013
Device: Kobo Touch, Aura One
|
Cripes, don't know how I missed that... ok, have changed my code to use % instead of @.
Quote:
Thanks for all the help! It's making a lot more sense now. |
|
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
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 |