diff options
-rw-r--r-- | 12_Prompts.zsh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 8b7c259..053210c 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -105,13 +105,14 @@ update_prompt() ## Time POWERADAPTER=$(grep "^AC Power" /proc/pmu/info | cut -c26) + ISCHARGING=$(grep "^current" /proc/pmu/battery_0 | cut -c14) BATTERYTIME=$(ibam -r | head -n1 | cut -c30- | cut -d: -f1,2 | tr ':' 'h') BATTERYTMP="-"$BATTERYTIME BATTERYSIZE=${#BATTERYTMP} BATTERYTIMEMIN=$(( $(echo $BATTERYTIME | cut -dh -f1) * 60 + $(echo $BATTERYTIME | cut -dh -f2) )) - if [ $POWERADAPTER -eq 1 -a $BATTERYTIME != "0:00" ] + if [ $POWERADAPTER -eq 1 -a $ISCHARGING -ne 0 ] then BATTERYCOLOR="charging" else |