<commit_before>#!/bin/zsh
# battery.sh 

# Get battery level
	source_power=`pmset -g ps | awk 'NR==1{print $4,$5}'`
	parcentage=`pmset -g ps |awk 'NR==2{print $2}' | awk 'BEGIN{FS="%;";}{print $1}'` 

# 100% (AC Power) Blue
if [ "${parcentage}" -eq "100" ] || [ "${source_power}" = "AC Power" ]; then
	echo '#[fg=colour51]100%#[default]'
fi

# 31% ~ 99% Green
if [ "${parcentage}" -gt "30" ] && [ "${parcentage}" -lt "100" ]; then
	echo '#[fg=colour46]'${parcentage}'%#[default]'
fi

# 1% ~ 30% Red
if [ "${parcentage}" -le "30" ]; then
	echo -e '#[fg=colour197]'${parcentage}'%#[default]'
fi<commit_msg>Rewrite control syntax<commit_after>#!/bin/zsh
# battery.sh 

# Checking whether AC adapter are connected
	power_source=`pmset -g ps | awk 'NR==2{print $3}'`
# Get battery level
	parcentage=`pmset -g ps |awk 'NR==2{print $2}' | awk 'BEGIN{FS="%;";}{print $1}'` 

#------------
# Rewrite
#------------

# If AC adapter are connected, color is Yellow
if [ "${power_source}" = "charging;" ]; then
	# If charging, font colour is yellow
	fgcolour="#[fg=colour226]"

# 100% Blue
elif [ "${parcentage}" -eq "100" ]; then 
	fgcolour='#[fg=colour51]'

# 31% ~ 99% Green
elif [ "${parcentage}" -gt "30" ] && [ "${parcentage}" -lt "100" ]; then
	fgcolour="#[fg=colour46]"

# 1% ~ 30% Red
elif [ "${parcentage}" -le "30" ]; then
	fgcolour="#[fg=colour197]"

fi

echo -e ${fgcolour}${parcentage}'%#[default]'

{'fraction_non_alphanumeric': 0.24857142857142858, 'fraction_numerical': 0.05071428571428571, 'mean_word_length': 4.306818181818182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7435842', 'n_tokens_mistral': 622, 'n_tokens_neox': 548, 'n_words': 141}