Reboot par triple-tap (finger_trace) + indice pied de page
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
35
kobo/reboot_watcher.sh
Executable file
35
kobo/reboot_watcher.sh
Executable file
@@ -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
|
||||
Reference in New Issue
Block a user