diff --git a/backend/templates/dashboard.html b/backend/templates/dashboard.html index 52910c7..af31bc4 100644 --- a/backend/templates/dashboard.html +++ b/backend/templates/dashboard.html @@ -133,7 +133,7 @@ {% endif %} diff --git a/kobo/monitorink.sh b/kobo/monitorink.sh index 8816e35..aa2f724 100755 --- a/kobo/monitorink.sh +++ b/kobo/monitorink.sh @@ -52,6 +52,9 @@ fi # Synchronise l'horloge RTC (sinon rtcwake calcule mal le réveil). hwclock -w -u 2>/dev/null +# Watcher triple-tap -> reboot (en arrière-plan, écran tactile libre car Nickel est mort). +sh "$BASE/reboot_watcher.sh" & + # Boucle bloquante. À la sortie (STOP tue monitorinkloop.sh), on reboot pour restaurer Nickel. sh "$BASE/monitorinkloop.sh" >> "$LOG" 2>&1 diff --git a/kobo/reboot_watcher.sh b/kobo/reboot_watcher.sh new file mode 100755 index 0000000..38e05af --- /dev/null +++ b/kobo/reboot_watcher.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Monitorink — redémarrage par TRIPLE-TAP (restaure Nickel / relance proprement). +# Lancé en arrière-plan par monitorink.sh (après que Nickel a été tué -> écran tactile libre). +# Utilise finger_trace (FBInk) pour détecter les touchers ; pas de mapping de coordonnées. + +BASE="$(dirname "$0")" +cd "$BASE" || exit 1 +LOG="$BASE/monitorink.log" +FT="./bin/fbink/finger_trace" +FBINK="./bin/fbink/fbink" + +[ -x "$FT" ] || { echo "[watcher] finger_trace absent" >> "$LOG"; exit 0; } +echo "[watcher] triple-tap reboot actif" >> "$LOG"; sync + +count=0 +last=0 +"$FT" 2>&1 | while read -r line; do + # DEBUG (à retirer après calage) : voir le format réel de finger_trace. + echo "[ft] $line" >> "$LOG" + case "$line" in + *UP*|*RELEASE*|*Release*) + now=$(date +%s) + [ $((now - last)) -gt 3 ] && count=0 + count=$((count + 1)) + last=$now + echo "[watcher] tap $count/3" >> "$LOG"; sync + if [ "$count" -ge 3 ]; then + echo "[watcher] TRIPLE-TAP -> reboot" >> "$LOG"; sync + "$FBINK" -c -pmh "Redemarrage..." 2>/dev/null + sleep 1; sync + reboot + fi + ;; + esac +done