mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
reworked parameter parsing a bit
this still allows to use last viewed document even when we flag that the framework should be stopped
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
P D = !/mnt/us/launchpad/kpdf.sh /mnt/us/documents
|
||||
# start kindlepdfviewer with last document
|
||||
P P = !/mnt/us/launchpad/kpdf.sh
|
||||
# start kindlepdfviewer without framework
|
||||
P K = !/mnt/us/launchpad/kpdf.sh /mnt/us/documents framework_stop
|
||||
# start kindlepdfviewer without framework in /mnt/us/documents
|
||||
P K = !/mnt/us/launchpad/kpdf.sh --framework_stop /mnt/us/documents
|
||||
# start kindlepdfviewer without framework on last read document
|
||||
P L = !/mnt/us/launchpad/kpdf.sh --framework_stop
|
||||
# restart amazon framework - when it got irritated
|
||||
P R = !/etc/init.d/framework restart
|
||||
|
||||
@@ -4,15 +4,27 @@ export LC_ALL="en_US.UTF-8"
|
||||
echo unlock > /proc/keypad
|
||||
echo unlock > /proc/fiveway
|
||||
|
||||
# we're always starting from our working directory
|
||||
cd /mnt/us/kindlepdfviewer/
|
||||
|
||||
grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts || mount -o bind /usr/java/lib/fonts /mnt/us/kindlepdfviewer/fonts/host
|
||||
# bind-mount system fonts
|
||||
if ! grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then
|
||||
mount -o bind /usr/java/lib/fonts /mnt/us/kindlepdfviewer/fonts/host
|
||||
fi
|
||||
|
||||
test "$2" == "framework_stop" && /etc/init.d/framework stop
|
||||
# check if we are supposed to shut down the Amazon framework
|
||||
if test "$1" == "--framework_stop"; then
|
||||
shift 1
|
||||
/etc/init.d/framework stop
|
||||
fi
|
||||
|
||||
# finally call reader
|
||||
./reader.lua "$1" 2> /mnt/us/kindlepdfviewer/crash.log || cat /mnt/us/kindlepdfviewer/crash.log
|
||||
|
||||
grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts && umount /mnt/us/kindlepdfviewer/fonts/host
|
||||
# unmount system fonts
|
||||
if grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then
|
||||
umount /mnt/us/kindlepdfviewer/fonts/host
|
||||
fi
|
||||
|
||||
# always try to continue cvm
|
||||
killall -cont cvm || /etc/init.d/framework start
|
||||
|
||||
Reference in New Issue
Block a user