Skip to content
This repository was archived by the owner on Nov 12, 2022. It is now read-only.

Commit 12255b9

Browse files
committed
add missing booklet.sh file
1 parent dcb9bf2 commit 12255b9

File tree

3 files changed

+77
-1
lines changed

3 files changed

+77
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
.classpath
55
.project
66

7-
bin/
7+
./bin/
88
build/
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/sh
2+
#
3+
# KUAL KPVBooklet helper
4+
#
5+
6+
# KOReader's working directory
7+
KOREADER_DIR="/mnt/us/koreader"
8+
9+
# Load our helper functions...
10+
if [ -f "${KOREADER_DIR}/libkohelper.sh" ] ; then
11+
source "${KOREADER_DIR}/libkohelper.sh"
12+
else
13+
echo "Can't source helper functions, aborting!"
14+
exit 1
15+
fi
16+
17+
## Handle logging...
18+
logmsg()
19+
{
20+
# Use the right tools for the platform
21+
if [ "${INIT_TYPE}" == "sysv" ] ; then
22+
msg "koreader: ${1}" "I"
23+
elif [ "${INIT_TYPE}" == "upstart" ] ; then
24+
f_log I koreader kual "" "${1}"
25+
fi
26+
27+
# And handle user visual feedback via eips...
28+
eips_print_bottom_centered "${1}" 1
29+
}
30+
31+
32+
# Handle cre's settings...
33+
set_cre_prop()
34+
{
35+
# We need at least two args
36+
if [ $# -lt 2 ] ; then
37+
logmsg "not enough arg passed to set_cre_prop"
38+
return
39+
fi
40+
41+
cre_prop_key="${1}"
42+
cre_prop_value="${2}"
43+
44+
cre_config="/mnt/us/extensions/kpvbooklet/bin/booklet.ini"
45+
46+
touch ${cre_config}
47+
48+
# Check that the config exists...
49+
if [ -f "${cre_config}" ] ; then
50+
# dos2unix
51+
sed -e "s/$(echo -ne '\r')$//g" -i "${cre_config}"
52+
53+
grep ^${cre_prop_key}= "${cre_config}">/dev/null
54+
if [ $? -eq 1 ] ; then
55+
echo "${cre_prop_key}=${cre_prop_value}">>"${cre_config}"
56+
logmsg "Set ${cre_prop_key} to ${cre_prop_value}"
57+
return
58+
fi
59+
60+
# And finally set the prop
61+
sed -re "s/^(${cre_prop_key})(=)(.*?)$/\1\2${cre_prop_value}/" -i "${cre_config}"
62+
if [ $? -eq 0 ] ; then
63+
logmsg "Set ${cre_prop_key} to ${cre_prop_value}"
64+
else
65+
logmsg "Failed to set ${cre_prop_key}"
66+
fi
67+
fi
68+
}
69+
70+
#eips_print_bottom_centered "test now" 1
71+
# logmsg "its working OK $@"
72+
73+
set_cre_prop ${1} ${2}
74+
75+

install.ffs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ if [ "$VERSION" \> "5.4" ]; then
5858
fi
5959

6060
progress 80 "Installing KUAL Extension"
61+
mkdir -p /mnt/us/extensions
6162
cp -r extensions/kpvbooklet /mnt/us/extensions/ || fail "Unable to copy KUAL Extension"
6263

6364
progress 90 "Mounting ro"

0 commit comments

Comments
 (0)