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

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-15-2015, 07:07 PM   #1
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,016
Karma: 2369310
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
AutoShelf

This is another one of my experiments.

I prefer folder navigation over anything else really, but the Kobo doesn't have it. It only offers shelves/collections. So I wrote a script that creates a shelf for each folder, and puts everything in that folder onto the shelf. (I know Calibre has a feature to do this, but I don't use Calibre for putting books on the reader.)

These shelves are updated whenever the reader leaves the "connected and charged" screen after unplugging the USB cable, and only if there was a change in your list of books since the previous update. Building the list of shelves takes a few minutes if you have lots of files. There is no visual feedback when it's done. Unfortunately for internal reasons I've yet to overcome, the shelves are not displayed instantly but require yet another plug-connect-unplug cycle (or alternatively a reboot).

Any shelf created by this addon will end with /. So books in the root directory will be in the '/' shelf, and then there's a 'Harry Potter/' shelf - if you have a subdir for that series. Since there is no shelf-within-shelf feature (or is there?), shelves for deeper structures will end up as 'some/other/shelf/', so you get a flattened view of all subdirs.

It also sets the Series and SeriesNumber properties of books, but it only works if the number is the first element of your filename (like 'Harry Potter/001 Philosophers Stone.epub'). That way you can see the folder and series number anywhere in the book list. Otherwise it will show the filename.

Sorting within a shelf unfortunately does not work at all. I do not understand it. There are two sort options that relate to date (recent and date added). But no matter what dates I set in the database, it does not seem to affect sorting. I even tried setting file timestamps, to no avail. Either there's a date field I'm missing, or I'm setting them wrong, or the firmware is buggy and does something else when it claims to be date sorting.

Note there is a chance this will corrupt your database. Make backups of your .kobo/KoboReader.sqlite.

To install, copy KoboRoot-AutoShelf.tgz » .kobo/KoboRoot.tgz

To uninstall, create .autoshelf-uninstall (empty directory or file without extension). On successful uninstall it will be renamed to .autoshelf-uninstalled-$date (and you can delete it). Uninstalling will also remove the shelves that were created by autoshelf (those that end with /).

http://github.com/frostschutz/Kobo

Alternative: Manually

Run AutoShelf only if you swipe the screen as you unplug the device. This is an alternative that may become the standard behaviour in the future. http://www.mobileread.com/forums/sho...60#post3127960
Attached Files
File Type: zip KoboRoot-AutoShelf.zip (261.5 KB, 45 views)
File Type: zip KoboRoot-AutoShelf-Manually.zip (261.6 KB, 1 views)

Last edited by frostschutz; Today at 09:46 AM.
frostschutz is online now   Reply With Quote
Old 01-15-2015, 07:24 PM   #2
freekobo
Zealot
freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.freekobo ought to be getting tired of karma fortunes by now.
 
freekobo's Avatar
 
Posts: 111
Karma: 284288
Join Date: Jan 2013
Device: Kobo Aura
Nice! It seems to work good. Thanks.
freekobo is offline   Reply With Quote
Old 01-16-2015, 02:25 AM   #3
boriar
Zealot
boriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blueboriar can differentiate black from dark navy blue
 
Posts: 118
Karma: 13124
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O
YEAAAAAH! You are the MAN!
At this moment I'm too busy but this weekend I will try it, sure! It's a pain that there aren't sub-collections
boriar is offline   Reply With Quote
Old 01-17-2015, 07:19 PM   #4
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,016
Karma: 2369310
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
The database corrupted too often, so in beta2 I'm using another method which seems to work better.

After pulling the USB plug, nickel will be put on hold until AutoShelf has done its work. During that time the device will appear to be stuck in the "Connected and Charged" screen. You will need to wait a few seconds (until AutoShelf has decided there is no shelf to update) or 2-3 minutes (for actually updating shelves, time depending on your number of files).

I tried displaying a progress bar at this point (like the on-animator) but unfortunately nickel does not manage to use the display properly afterwards. If someone knows how to display stuff w/o harming nickel...
frostschutz is online now   Reply With Quote
Old 01-17-2015, 07:45 PM   #5
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 1,906
Karma: 475250
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by frostschutz View Post

I tried displaying a progress bar at this point (like the on-animator) but unfortunately nickel does not manage to use the display properly afterwards. If someone knows how to display stuff w/o harming nickel...
You could try something like

Code:
currentRotation=$(cat /sys/class/graphics/fb0/rotate)
#write to the screen and so on
echo "$currentRotation" > /sys/class/graphics/fb0/rotate
#only now revive nickel
tshering is offline   Reply With Quote
Old 01-18-2015, 05:14 AM   #6
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,016
Karma: 2369310
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
tshering, that is an improvement. But when I do that, nickel is turned on its head (180°) and stays that way... still it suggests it could work if one found the right rotate value that nickel needs after pickel displayed an image... I will do some more experimenting
----
It appears, what you write to rotate is the opposite of what you get:

Code:
# cat /sys/class/graphics/fb0/rotate
3
# echo 3 > /sys/class/graphics/fb0/rotate
# cat /sys/class/graphics/fb0/rotate
1
# echo 1 > /sys/class/graphics/fb0/rotate
# cat /sys/class/graphics/fb0/rotate
3
That is strange, but should be easy enough to check for and deal with.
----
This works:
Code:
currentRotation=$(cat /sys/class/graphics/fb0/rotate)
#write to the screen and so on
echo "$currentRotation" > /sys/class/graphics/fb0/rotate
cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate
#only now revive nickel
I'll add some progress indication in the next beta...

Last edited by frostschutz; 01-18-2015 at 05:34 AM.
frostschutz is online now   Reply With Quote
Old 01-18-2015, 06:05 AM   #7
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 1,906
Karma: 475250
Join Date: Jun 2012
Device: kobo touch
This is interesting. I think however one has to take into account the device model. I believe for all models apart from Aura HD and Aura H2O (and maybe Aura 6) one has to set the same value that one has read. (Edit: thinking it over again, I am not sure about Aura HD. I think you need some user feedback.)

Somehow related to this might be a problem I am having with Qt applications. When an Qt application is started on Aura HD (and I guess on H2O also) after nickel has been killed the application is rotated upside down. Next time the Qt application is started, it is showing normal, next time it is again rotated, and so on. I did this not see myself, but have from reports. I just mention it in case you find something during your investigations that could help me.

Last edited by tshering; 01-18-2015 at 06:08 AM.
tshering is offline   Reply With Quote
Old 01-18-2015, 09:01 AM   #8
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,016
Karma: 2369310
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
If some Kobos for some reason invert the rotation value, and others don't, my workaround should work for all because for those who don't, the additional cat rotate > rotate changes nothing. And for those who do it fixes the 180°. But that's just a theory, I don't have any other Kobo to test with.
frostschutz is online now   Reply With Quote
Old 01-18-2015, 09:57 AM   #9
surquizu
Addict
surquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five wordssurquizu can name that ebook in five words
 
surquizu's Avatar
 
Posts: 270
Karma: 37744
Join Date: Jun 2008
Location: Zaragoza (Spain)
Device: prs-505, kobo auraHD, kobo auraH2O
I like it! Thanks.

I have an aura HD
Attached Thumbnails
Click image for larger version

Name:	screen_001.png
Views:	370
Size:	79.8 KB
ID:	133929  
surquizu is offline   Reply With Quote
Old 01-18-2015, 11:28 AM   #10
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 1,906
Karma: 475250
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by frostschutz View Post
If some Kobos for some reason invert the rotation value, and others don't, my workaround should work for all because for those who don't, the additional cat rotate > rotate changes nothing. And for those who do it fixes the 180°. But that's just a theory, I don't have any other Kobo to test with.
As for the theory, could you please give me a hint why cat rotate > rotate does have any effect at all?
tshering is offline   Reply With Quote
Old 01-18-2015, 01:25 PM   #11
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,016
Karma: 2369310
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
Quote:
Originally Posted by tshering View Post
As for the theory, could you please give me a hint why cat rotate > rotate does have any effect at all?
Because for some strange reason, the value you set is the opposite of the value you get. So you set $originalrotation but get its opposite; cat rotate > rotate then sets the opposite and gets $originalrotation.
----
Quote:
Originally Posted by surquizu View Post
I like it! Thanks.
Glad you like it, and thanks for the picture. I don't have paths as long as yours, so I never noticed they get cut off like that. Not sure what to do about it though. I could set a max length and then cut the left part off, but it would completely mess up the sorting.

Last edited by frostschutz; 01-18-2015 at 01:29 PM.
frostschutz is online now   Reply With Quote
Old 01-18-2015, 02:16 PM   #12
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 1,906
Karma: 475250
Join Date: Jun 2012
Device: kobo touch
Quote:
Originally Posted by frostschutz View Post
Because for some strange reason, the value you set is the opposite of the value you get. So you set $originalrotation but get its opposite; cat rotate > rotate then sets the opposite and gets $originalrotation.
Thank you for the answer. This seems not be the case on the Glo, for instance.

Spoiler:
Code:
(none) login: root
[root@(none) ~]# cat /sys/class/graphics/fb0/rotate
0
[root@(none) ~]# echo 1 > /sys/class/graphics/fb0/rotate
[root@(none) ~]# cat /sys/class/graphics/fb0/rotate
1
[root@(none) ~]# echo 0 > /sys/class/graphics/fb0/rotate
[root@(none) ~]# cat /sys/class/graphics/fb0/rotate
0
[root@(none) ~]# cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/ro
tate
[root@(none) ~]# cat /sys/class/graphics/fb0/rotate
0
[root@(none) ~]# # I started at this point nickel on the reader
[root@(none) ~]# cat /sys/class/graphics/fb0/rotate
3
[root@(none) ~]# echo 0 > /sys/class/graphics/fb0/rotate
[root@(none) ~]# cat /sys/class/graphics/fb0/rotate
0
[root@(none) ~]# echo 3 > /sys/class/graphics/fb0/rotate
[root@(none) ~]# cat /sys/class/graphics/fb0/rotate
3
tshering is offline   Reply With Quote
Old 01-19-2015, 04:02 PM   #13
frostschutz
Linux User
frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.frostschutz ought to be getting tired of karma fortunes by now.
 
frostschutz's Avatar
 
Posts: 1,016
Karma: 2369310
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: Kobo H2O, iriver StoryHD
beta3 adds a progress indicator (which looks like the power on animation because I'm just using that for now), so it doesn't just hang in the "connected and charged" screen while it's working.

I still haven't figured out the book order within a shelf. And I don't want to do the obvious workaround (adding series number to author or title - it doesn't belong there).

Last edited by frostschutz; 01-19-2015 at 04:05 PM.
frostschutz is online now   Reply With Quote
Old 01-19-2015, 05:33 PM   #14
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 1,906
Karma: 475250
Join Date: Jun 2012
Device: kobo touch
Thank you for your inspiring work, Frostschutz!

I think the on-animation could be a problem on some devices, since Sergey's fmon uses this script to start (possibly several) copies of fmon.

I am using /etc/init.d/update-animator.sh for visual feedback, even if this might startle some users.
tshering is offline   Reply With Quote
Old 01-19-2015, 07:04 PM   #15
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 7,295
Karma: 7360117
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo: Touch, Glo, Aura H2O, Glo HD
Quote:
Originally Posted by frostschutz View Post
I still haven't figured out the book order within a shelf. And I don't want to do the obvious workaround (adding series number to author or title - it doesn't belong there).
It doesn't really matter as the shelves have the same sort order options as the main library list. Plus one extra that is "Date added". That is supposedly the date added to the shelf, but it is broken in recent firmware. If you manually add four or five books to the shelf, it works, but when you restart the device, the order is wacky.
davidfor 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
New Beta for BB? FF2 Amazon Kindle 2 05-28-2011 10:21 AM
Development Signing up for the beta glen enTourage Archive 16 04-06-2011 04:33 PM
Beta Beta Test of Major New Features Starson17 Calibre 45 05-17-2010 10:55 AM
0.6 out of beta? Nate the great Calibre 3 07-17-2009 02:45 AM


All times are GMT -4. The time now is 01:29 PM.


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