|
|
@ -73,15 +73,15 @@ export STARDICT_DATA_DIR="data/dict"
|
|
|
|
# export external font directory
|
|
|
|
# export external font directory
|
|
|
|
export EXT_FONT_DIR="/mnt/onboard/fonts"
|
|
|
|
export EXT_FONT_DIR="/mnt/onboard/fonts"
|
|
|
|
|
|
|
|
|
|
|
|
# fast and dirty way of check if we are called from nickel
|
|
|
|
# Quick'n dirty way of checking if we were started while Nickel was running (e.g., KFMon),
|
|
|
|
# through fmon/KFMon, or from another launcher (KSM or advboot)
|
|
|
|
# or from another launcher entirely, outside of Nickel (e.g., KSM).
|
|
|
|
# Do not delete this line because KSM detects newer versions of KOReader by the presence of the phrase 'from_nickel'.
|
|
|
|
VIA_NICKEL="false"
|
|
|
|
export FROM_NICKEL="false"
|
|
|
|
|
|
|
|
if pkill -0 nickel; then
|
|
|
|
if pkill -0 nickel; then
|
|
|
|
FROM_NICKEL="true"
|
|
|
|
VIA_NICKEL="true"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# NOTE: Do not delete this line because KSM detects newer versions of KOReader by the presence of the phrase 'from_nickel'.
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${FROM_NICKEL}" = "true" ]; then
|
|
|
|
if [ "${VIA_NICKEL}" = "true" ]; then
|
|
|
|
# Detect if we were started from KFMon
|
|
|
|
# Detect if we were started from KFMon
|
|
|
|
FROM_KFMON="false"
|
|
|
|
FROM_KFMON="false"
|
|
|
|
if pkill -0 kfmon; then
|
|
|
|
if pkill -0 kfmon; then
|
|
|
@ -91,13 +91,22 @@ if [ "${FROM_NICKEL}" = "true" ]; then
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Siphon a few things from nickel's env (namely, stuff exported by rcS *after* on-animator.sh has been launched)...
|
|
|
|
# Check if Nickel is our parent...
|
|
|
|
eval "$(xargs -n 1 -0 <"/proc/$(pidof nickel)/environ" | grep -e DBUS_SESSION_BUS_ADDRESS -e NICKEL_HOME -e WIFI_MODULE -e LANG -e WIFI_MODULE_PATH -e INTERFACE 2>/dev/null)"
|
|
|
|
FROM_NICKEL="false"
|
|
|
|
export DBUS_SESSION_BUS_ADDRESS NICKEL_HOME WIFI_MODULE LANG WIFI_MODULE_PATH INTERFACE
|
|
|
|
if [ -n "${NICKEL_HOME}" ]; then
|
|
|
|
|
|
|
|
FROM_NICKEL="true"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# If we were spawned outside of Nickel, we'll need a few extra bits from its own env...
|
|
|
|
|
|
|
|
if [ "${FROM_NICKEL}" = "false" ]; then
|
|
|
|
|
|
|
|
# Siphon a few things from nickel's env (namely, stuff exported by rcS *after* on-animator.sh has been launched)...
|
|
|
|
|
|
|
|
eval "$(xargs -n 1 -0 <"/proc/$(pidof nickel)/environ" | grep -e DBUS_SESSION_BUS_ADDRESS -e NICKEL_HOME -e WIFI_MODULE -e LANG -e WIFI_MODULE_PATH -e INTERFACE 2>/dev/null)"
|
|
|
|
|
|
|
|
export DBUS_SESSION_BUS_ADDRESS NICKEL_HOME WIFI_MODULE LANG WIFI_MODULE_PATH INTERFACE
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# flush disks, might help avoid trashing nickel's DB...
|
|
|
|
# Flush disks, might help avoid trashing nickel's DB...
|
|
|
|
sync
|
|
|
|
sync
|
|
|
|
# stop kobo software because it's running
|
|
|
|
# And we can now stop the full Kobo software stack
|
|
|
|
# NOTE: We don't need to kill KFMon, it's smart enough not to allow running anything else while we're up
|
|
|
|
# NOTE: We don't need to kill KFMon, it's smart enough not to allow running anything else while we're up
|
|
|
|
killall -TERM nickel hindenburg sickel fickel fmon 2>/dev/null
|
|
|
|
killall -TERM nickel hindenburg sickel fickel fmon 2>/dev/null
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -316,11 +325,9 @@ if [ -n "${ORIG_CPUFREQ_GOV}" ]; then
|
|
|
|
echo "${ORIG_CPUFREQ_GOV}" >"/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
|
|
|
|
echo "${ORIG_CPUFREQ_GOV}" >"/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${FROM_NICKEL}" = "true" ]; then
|
|
|
|
if [ "${VIA_NICKEL}" = "true" ]; then
|
|
|
|
if [ "${FROM_KFMON}" != "true" ]; then
|
|
|
|
if [ "${FROM_KFMON}" = "true" ]; then
|
|
|
|
# start kobo software because it was running before koreader
|
|
|
|
# KFMon is the only launcher that has a toggle to either reboot or restart Nickel on exit
|
|
|
|
./nickel.sh &
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
if grep -q "reboot_on_exit=false" "/mnt/onboard/.adds/kfmon/config/koreader.ini" 2>/dev/null; then
|
|
|
|
if grep -q "reboot_on_exit=false" "/mnt/onboard/.adds/kfmon/config/koreader.ini" 2>/dev/null; then
|
|
|
|
# KFMon asked us to restart nickel on exit (default since KFMon 0.9.5)
|
|
|
|
# KFMon asked us to restart nickel on exit (default since KFMon 0.9.5)
|
|
|
|
./nickel.sh &
|
|
|
|
./nickel.sh &
|
|
|
@ -328,6 +335,9 @@ if [ "${FROM_NICKEL}" = "true" ]; then
|
|
|
|
# KFMon asked us to restart the device on exit
|
|
|
|
# KFMon asked us to restart the device on exit
|
|
|
|
/sbin/reboot
|
|
|
|
/sbin/reboot
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
# Otherwise, just restart Nickel
|
|
|
|
|
|
|
|
./nickel.sh &
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
# if we were called from advboot then we must reboot to go to the menu
|
|
|
|
# if we were called from advboot then we must reboot to go to the menu
|
|
|
|