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, 08: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: 2,177
Karma: 5052820
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: H2O, StoryHD, PW4
AutoShelf

AutoShelfFlashCardHyphenDictsMagicMemoryMiniClockNickelIconsScreenSaverUsbDebugWebPortal(GitHub)

--- AutoShelf ---

Automatically create shelves/collections based on folder structure on the Kobo. This is an alternative to the collection management features in Calibre's Kobo addons.

AutoShelf runs when you unplug the reader from PC; since building the list of shelves can take some time, and applies only to books that Kobo already added to its database, running AutoShelf on disconnect is optional:

You can enable/disable it by tapping the screen while the Kobo is connected to PC.

While connected to PC, an icon will be displayed and when enabled, it will say "AUTOSHELF".

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. That way you can see the folder and series number anywhere in the book list. Otherwise it will show the filename.

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 run AutoShelf, tap the display once while the Kobo is connected to the PC. (Note it will only process books that already are in the Kobo database, so this is an additional step after copying new books on).

To customize behaviour of the addon, there is a config file in .addons/autoshelf/autoshelf.cfg [installed as autoshelf.example.cfg, to be renamed by you]

More about the config file here: https://www.mobileread.com/forums/sh...87#post3184887

To uninstall, set uninstall=1 in the config file, then run AutoShelf one more time.

Edit: Update for 4.6.9960 firmware.

Edit: Use fbink instead of pngshow to show image (no other change)
Attached Thumbnails
Click image for larger version

Name:	autoshelf.png
Views:	1604
Size:	43.7 KB
ID:	151493   Click image for larger version

Name:	autoshelf-off.png
Views:	1209
Size:	31.7 KB
ID:	151496  
Attached Files
File Type: zip KoboRoot-AutoShelf-20160916.zip (357.4 KB, 965 views)
File Type: zip KoboRoot-AutoShelf-20171010.zip (1.16 MB, 821 views)
File Type: zip KoboRoot-AutoShelf-20181027.zip (1.34 MB, 971 views)
File Type: zip KoboRoot-AutoShelf-20200702.zip (1.47 MB, 346 views)

Last edited by frostschutz; 07-02-2020 at 01:05 PM.
frostschutz is offline   Reply With Quote
Old 01-15-2015, 08:24 PM   #2
freekobo
Addict
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: 250
Karma: 2731310
Join Date: Jan 2013
Device: Kobo Aura
Nice! It seems to work good. Thanks.
freekobo is offline   Reply With Quote
Advert
Old 01-16-2015, 03:25 AM   #3
boriar
Evangelist
boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.boriar ought to be getting tired of karma fortunes by now.
 
Posts: 402
Karma: 314204
Join Date: Jan 2015
Device: bq Avant XL, Kobo Aura H2O, Onyx Boox M96C Plus
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, 08: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: 2,177
Karma: 5052820
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: H2O, StoryHD, PW4
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 offline   Reply With Quote
Old 01-17-2015, 08: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: 3,485
Karma: 2914715
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
Advert
Old 01-18-2015, 06: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: 2,177
Karma: 5052820
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: H2O, StoryHD, PW4
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 06:34 AM.
frostschutz is offline   Reply With Quote
Old 01-18-2015, 07: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: 3,485
Karma: 2914715
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 07:08 AM.
tshering is offline   Reply With Quote
Old 01-18-2015, 10: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: 2,177
Karma: 5052820
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: H2O, StoryHD, PW4
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 offline   Reply With Quote
Old 01-18-2015, 10:57 AM   #9
surquizu
Evangelist
surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.surquizu ought to be getting tired of karma fortunes by now.
 
surquizu's Avatar
 
Posts: 411
Karma: 902071
Join Date: Jun 2008
Location: Zaragoza (Spain)
Device: prs-505, kobo auraHD, kobo auraH2O, kobo Glo HD, kobo aura ONE
I like it! Thanks.

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

Name:	screen_001.png
Views:	2143
Size:	79.8 KB
ID:	133929  
surquizu is offline   Reply With Quote
Old 01-18-2015, 12:28 PM   #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: 3,485
Karma: 2914715
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, 02: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: 2,177
Karma: 5052820
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: H2O, StoryHD, PW4
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 02:29 PM.
frostschutz is offline   Reply With Quote
Old 01-18-2015, 03: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: 3,485
Karma: 2914715
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, 05: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: 2,177
Karma: 5052820
Join Date: Sep 2010
Location: Heidelberg, Germany
Device: H2O, StoryHD, PW4
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 05:05 PM.
frostschutz is offline   Reply With Quote
Old 01-19-2015, 06: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: 3,485
Karma: 2914715
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, 08: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: 20,889
Karma: 36705894
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
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 11:21 AM
Development Signing up for the beta glen enTourage Archive 16 04-06-2011 05:33 PM
Beta Beta Test of Major New Features Starson17 Calibre 45 05-17-2010 11:55 AM
0.6 out of beta? Nate the great Calibre 3 07-17-2009 03:45 AM


All times are GMT -4. The time now is 11:59 AM.


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