From 321371888c8322a268be28abe0438bb0e1651c2d Mon Sep 17 00:00:00 2001 From: Daniele Verducci Date: Sat, 25 Feb 2023 11:22:00 +0100 Subject: [PATCH 1/2] Compatibility with Kindle PW Touch --- src/dash.sh | 6 +++++- src/local/fetch-dashboard.sh | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/dash.sh b/src/dash.sh index a1eaa09..aaa0864 100755 --- a/src/dash.sh +++ b/src/dash.sh @@ -27,7 +27,11 @@ init() { echo "Starting dashboard with $REFRESH_SCHEDULE refresh..." - /etc/init.d/framework stop + if [ -f /etc/init.d/framework ]; then + /etc/init.d/framework stop + else + /etc/init/framework stop + fi initctl stop webreader >/dev/null 2>&1 echo powersave >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor lipc-set-prop com.lab126.powerd preventScreenSaver 1 diff --git a/src/local/fetch-dashboard.sh b/src/local/fetch-dashboard.sh index 0733233..dc2d549 100755 --- a/src/local/fetch-dashboard.sh +++ b/src/local/fetch-dashboard.sh @@ -1,4 +1,10 @@ #!/usr/bin/env sh + +# Url of content to download +CONTENT="https://raw.githubusercontent.com/pascalw/kindle-dash/master/example/example.png" + # Fetch a new dashboard image, make sure to output it to "$1". # For example: -"$(dirname "$0")/../xh" -d -q -o "$1" get https://raw.githubusercontent.com/pascalw/kindle-dash/master/example/example.png +# "$(dirname "$0")/../xh" -d -q -o "$1" get $CONTENT +# xh seems not to be able to load certificates on Kindle PW Touch, and wget has same problem, curl should work everywhere +curl -o "$1" "$CONTENT" From f9c4d10e20e64b81e566bd58f315bcbeb883b176 Mon Sep 17 00:00:00 2001 From: Daniele Verducci Date: Sat, 25 Feb 2023 11:41:52 +0100 Subject: [PATCH 2/2] Defaulting to xh and fallback to curl if it errs out --- src/local/fetch-dashboard.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/local/fetch-dashboard.sh b/src/local/fetch-dashboard.sh index dc2d549..494ddf3 100755 --- a/src/local/fetch-dashboard.sh +++ b/src/local/fetch-dashboard.sh @@ -5,6 +5,8 @@ CONTENT="https://raw.githubusercontent.com/pascalw/kindle-dash/master/example/ex # Fetch a new dashboard image, make sure to output it to "$1". # For example: -# "$(dirname "$0")/../xh" -d -q -o "$1" get $CONTENT -# xh seems not to be able to load certificates on Kindle PW Touch, and wget has same problem, curl should work everywhere -curl -o "$1" "$CONTENT" +"$(dirname "$0")/../xh" -d -q -o "$1" get $CONTENT +# xh seems not to be able to load certificates on Kindle PW Touch: fall back to curl in case of error +if [ $? != 0 ]; then + curl -o "$1" "$CONTENT" +fi \ No newline at end of file