From 7baa4f132c9ed864de28c68cf5c4fdfabf4121a1 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 29 Jan 2009 16:20:06 +0100 Subject: [PROMPT] battery charge complete workaround for ibam --- 12_Prompts.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3