#!/bin/sh fullPage=6 # How many pages before a full refresh? pCount=0 disableUpdates() { let pCount+=1 i=0 # I run it a bunch of times with a 0.05 delay as it is very hard to time when the page will turn and you don't want it to be trigger too early as it won't update the page and you don't want it too late as it will look bad. while [[ "$i" -lt "5" ]] ; do echo 18 2 > /proc/eink_fb/update_display echo 19 7 > /proc/eink_fb/update_display let i+=1 usleep 75000 done # Sets the next page turn to be a full refresh if [[ "$pCount" -ge "$(($fullPage-1))" ]]; then echo 19 0 > /proc/eink_fb/update_display pCount=0 fi } trap "rm /var/run/flashdis.pid ; exit" SIGINT SIGTERM if [[ ! -e "/var/run/flashdis.pid" ]]; then echo $$ > "/var/run/flashdis.pid" else echo "Flash disabler is already running" exit 1 fi while :; do waitforkey > /dev/null # I use all button presses as 19 7 messes up the menus. disableUpdates done