Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- fullPage=6 # How many pages before a full refresh?
- ### Do not edit below this line unless you know what you are doing ###
- pCount=0
- fullPage="$(($fullPage-1))"
- update() {
- let pCount+=1
- for i in 1 2 3 4 5 ; do
- echo 19 0 > /proc/eink_fb/update_display
- echo 0 > /sys/devices/platform/eink_fb.0/override_upd_mode
- echo 18 0 > /proc/eink_fb/update_display
- echo 1 > /sys/devices/platform/eink_fb.0/override_upd_mode
- echo 19 4 > /proc/eink_fb/update_display
- usleep 75000
- done
- # Sets the next page turn to be a full refresh
- if [[ "$pCount" -ge "$fullPage" ]]; then
- echo 0 > /sys/devices/platform/eink_fb.0/override_upd_mode
- 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
- # Monitor for eink update
- while :; do
- # Check if the modification time has changed (It only really changes for eink updates and occasionally wifi)
- mTime="$(stat -c %Y /var/log/messages 2> /dev/null)"
- if [[ "$mTime" -gt "$oldmTime" -a "$mTime" != "" ]]; then
- update
- fi
- # Don't update if the last update was within a second (May be a bad idea)
- oldmTime="$(($mTime+1))"
- usleep 250000
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement