<commit_before>#!/bin/sh

# Adopted from https://github.com/mpetroff/kindle-weather-display

# Quit when detect a disable flag
if [ -e disable ]; then exit 0; fi

cd "$(dirname "$0")"

# Check battery capacity
BATTERY=`grep -o "[0-9]*" /sys/devices/system/yoshi_battery/yoshi_battery0/battery_capacity`
CURRENT=`cat /sys/devices/system/yoshi_battery/yoshi_battery0/battery_current`

if [ $BATTERY -le 10 ] && [ $CURRENT -le 0 ]; then
	if [ -e drained ]; then
		# If already drawn drained image, then just leave. 
		exit 0;
	else
		touch drained
		# If device just got low power, then draw drained image. 
		eips -c
		eips -c
		eips -g battery-drained.png
	fi
else<commit_msg>Some changes to comment on script<commit_after>#!/bin/sh

# Adopted from https://github.com/mpetroff/kindle-weather-display
# First mntroot rw, then add following cronjob to /etc/crontab/root, then /etc/init.d/cron restart, finally mntroot ro
# 0 * * * * /bin/sh /mnt/us/weather-stand/update-weather.sh > /dev/null 2>&1
# BTW, I choose to put all files on USB drive instead of system partition. 

# Quit when detect a disable flag
if [ -e disable ]; then exit 0; fi

cd "$(dirname "$0")"

# Check battery capacity
BATTERY=`grep -o "[0-9]*" /sys/devices/system/yoshi_battery/yoshi_battery0/battery_capacity`
CURRENT=`cat /sys/devices/system/yoshi_battery/yoshi_battery0/battery_current`

if [ $BATTERY -le 10 ] && [ $CURRENT -le 0 ]; then
	if [ -e drained ]; then
		# If already drawn drained image, then just leave. 
		exit 0;
	else
		touch drained
		# If device just got low power, then draw drained image. 
		eips -c
		eips -c
		eips -g battery-drained.png
	fi
else
{'fraction_non_alphanumeric': 0.12119366626065774, 'fraction_numerical': 0.014007308160779537, 'mean_word_length': 3.615168539325843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2594947', 'n_tokens_mistral': 640, 'n_tokens_neox': 587, 'n_words': 184}