View Single Post
Old 05-18-2015, 02:44 AM   #258
AlterusPrime
Enthusiast
AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.AlterusPrime has a complete set of Star Wars action figures.
 
Posts: 38
Karma: 358
Join Date: May 2015
Device: Kobo Glo
I don't know if anybody will ever want to do the same thing as i did but i was trying to find the best way to do this for 2 days (i haven't changed, still bad at scripting).
I was trying to launch CoolReader directly and then exit directly to ksm, not to vlasovsoftlauncher. Found some not_updated_for_a_long_time scripts for that in KSM but even if i've updated them - CR loses sleeping function + sleepcover and a bunch of other things. "Not an option" i thought, and came up with this WEEEEIRD solution. But hey, it works at least. (AS IS. Even though it actually works and with 99,99% chance won't damage your device cause.. well, it just won't. This is just a bunch of shell scripts)

So, here's how.
WARNING: do NOT run vlasovsoft apps until you're done!
WARNING: only use UNIX-like editor to do this!
WARNING: you should be careful and/or know what you're doing!
SUGGESTION: you may want to backup everything you edit. or may not want. depends on you.
Spoiler:
1. You gotta prepare yourself a launcher.ini file. To do that, run vlasovsoftlauncher, press options and set everything as you like except for autorun option - it should be "none" for this to work right.
2. When you're done, connect your Kobo to PC, go to /mnt/onboard/.adds/vlasovsoft and rename launcher.ini to launcher.ini.dfl
2.5. You can rename cr3.sh to cr3.sh.bkp in the same folder if you feel like it.
3. Next you gotta get yourself a copy of start_vlasovlauncher.sh (if you're using CR 2015.05 - get it from the post above (https://www.mobileread.com/forums/sho...&postcount=257)
4. Now "magic begins". You gotta find a
Code:
# run launcher
section and change it to this
Spoiler:
cat $ROOT/launcher.ini.dfl > $ROOT/launcher.ini
echo "#!/bin/sh" >> $ROOT/cr3.sh
echo "exec cr3/cr3 -stylesheet $STYLESHEET" >> $ROOT/cr3.sh
$ROOT/launcher -qws -stylesheet $STYLESHEET

5. Anywhere after
Code:
$ROOT/launcher -qws -stylesheet $STYLESHEET
line (i suggest in the # remove fifo section, just because if already contains 2 rm commands, why not add some more) you gotta add these lines
Spoiler:

rm $ROOT/launcher.ini
rm $ROOT/cr3.sh

6. After all the modifications you've done, you should put it to /mnt/onboard/.adds/kbmenu/onstart and replace existing start_vlasovlauncher.sh with the one you've just made.
7. Now, copy the file you've just made and copy it to the very same folder and name it cr3.sh (notice: there's already one with this name, you gotta remove it first; notice 2: i'm talking about /mnt/onboard/.adds/kbmenu/onstart)
8. Now open it and find
Code:
# run launcher
section.
9. This section in this file should look like this:
Spoiler:
cat $ROOT/launcher.ini.dfl > $ROOT/launcher.ini
echo "autorun=CoolReader" >> $ROOT/launcher.ini
echo "#!/bin/sh" >> $ROOT/cr3.sh
echo "cr3/cr3 -stylesheet $STYLESHEET" >> $ROOT/cr3.sh
echo "echo "exit" > $VLASOVSOFT_FIFO1" >> $ROOT/cr3.sh
$ROOT/launcher -qws -stylesheet $STYLESHEET

10. Everything else remains the same, save changes and close the file.
11. Now go to /mnt/onboard/.adds/kbmenu/onstart/ksmhome.sh. (WARNING: You should be EXTREMELY careful while editing this, if you mess something up - you'll have to factory reset your kobo)
12. Find
Code:
insertCRportrait=false
, it's not far from beginning of the file
13. Change false to true, save, if you don't want to setup launching CoolReader from nickel - reboot the device, if you want this - proceed to 14.
14. Go to /mnt/onboard/.adds/vlasovsoft and edit launcher.sh
15. Add this to
Code:
#run launcher
section:
Spoiler:

cat $ROOT/launcher.ini.dfl > $ROOT/launcher.ini
echo "#!/bin/sh" >> $ROOT/cr3.sh
echo "exec cr3/cr3 -stylesheet $STYLESHEET" >> $ROOT/cr3.sh

16. And this to
Code:
#remove fifos
section
Spoiler:

rm $ROOT/launcher.ini
rm $ROOT/cr3.sh


Now KSM has 2 options - start vlasovsoftlauncher and start coolreader. Second option starts CoolReader "directly" (actually, it's still using the launcher, so all the launcher dependant options are working) and when you close CR - you're going straight to KSM. And first option starts vlasovsoftlauncher as always, with selection of all the additional things like sudoku.
There may be a better way to do this, i still didn't figure it out.
But hey, it works great (for me at least), so i'll leave it be until (not sure it would but still) it screws me over somehow.

Last edited by AlterusPrime; 05-18-2015 at 03:15 AM.
AlterusPrime is offline   Reply With Quote