![]() |
#1 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
Hack to reopen last book
I would find a way to reopen the last opened book at startup, if I shut down when the book was opened.
What I want to do is to write the document path to some file before the device is shut down if the document is open, and re-open the document when the OS is ready. The problems are:
|
![]() |
![]() |
![]() |
#3 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
Ok, this is what I have done:
Result: no OOOOOOK.txt even after another shutdown.... but my db is corrupted, since kobo doesn't find any book in my library even if the files are ok ![]() It seems that the OS doesn't use rc#.d scripts. Any other ideas? ![]() Last edited by Lucas Malor; 05-05-2013 at 03:34 PM. |
![]() |
![]() |
![]() |
#5 |
Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
Karma: 206176
Join Date: Apr 2013
Location: Europe
Device: Kobo Glo
|
don't forget to "chmod +x script.sh"
busybox probably doesn't support /etc/rc0.d however /etc/inittab should do as well by adding: Code:
::shutdown:/path/to/script.sh |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
......damnit :-P
Quote:
Code:
::shutdown:/etc/init.d/test Code:
::shutdown:/bin/umount -a -r ![]() EDIT: I also added sync at the end, but nothing Last edited by Lucas Malor; 05-06-2013 at 08:33 AM. Reason: added sync without success |
|
![]() |
![]() |
![]() |
#7 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
After some help from the BusyBox maling list, I've found that any output, even the stdout, is suppressed during the shutdown, but the script is executed. I don't know if there's a way to write an output on shutdown. Maybe I can use acpid to run a script when the power button is slided.
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
If acipd does not work as wished, I would like to draw your attention again to KevinShort's ingenious solution.
|
![]() |
![]() |
![]() |
#9 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
I completely missed you post, this is a lot more simple! I'll try it tomorrow
![]() The best for me will be to disable also the display of the shutdown image, so the last page will be displayed instead. Unfortunately, like Kevin, I have no idea where's the code that loads that image. |
![]() |
![]() |
![]() |
#10 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
Ok, it works! Now the real big problem is to find a way to open the book. I think there's no command line solution this time... probably books are managed by nickel? Furthermore I should be able to open it instead of showing the homepage, to save time.
Yoq, you have linked a library to nickel. Do you have any idea where I can find what I'm searching for? On Kobo git I can't find nothing useful. I can also simulate a touch on the first book, but it will be slow and not so useful. |
![]() |
![]() |
![]() |
#11 |
Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
Karma: 206176
Join Date: Apr 2013
Location: Europe
Device: Kobo Glo
|
My approach is described here: http://www.jayconrod.com/cgi/view_post.py?23
However, this is probably not useful for your problem, it's better suited to change the way nickel interacts with the kernel or other programs. I have not looked into it yet, but "ah-" seems to have gained some access to the nickel internas with his KoboTweaks plugin. |
![]() |
![]() |
![]() |
#12 |
Pain in the arse
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
|
So I have to take a look to tweaks code. ah- seems to be inactive...
![]() |
![]() |
![]() |
![]() |
#13 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 348
Karma: 209937
Join Date: Jan 2012
Location: Virginia, US
Device: Kobo Wifi, Kobo Glo
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Told to reopen bug ticket if someone else was interested, but... | ThePage | Calibre | 1 | 11-29-2012 12:04 AM |
Paid Hack Request: Photo Slideshow Hack for Kindle 3 | chmreader | Kindle Developer's Corner | 0 | 05-25-2011 01:24 PM |
New hack for the PRS-505. % of book read | surquizu | Sony Reader Dev Corner | 1 | 10-11-2009 01:30 AM |
Book titles hack? Time delay hack? | re838uk | Sony Reader | 0 | 10-08-2009 05:29 AM |
PRS-500 Please help: Copy Book Hack | mdhuang | Sony Reader Dev Corner | 9 | 10-21-2007 03:50 PM |