From a3df8b7498abdf8711bd05d6d9860b0e76142890 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Wed, 28 Jan 2009 11:20:12 +0100 Subject: [PROMPT] battery managment update, AC power and critical status --- 12_Prompts.zsh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 31240e0..74dd172 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -117,7 +117,7 @@ update_prompt() else if [ $BATTERYCHARGING -lt 0 ] then - if [ $BATTERY_TIME -lt 600 ] + if [ $BATTERY_TIME -lt 659 ] then BATTERY="$C_$battery_colors[critical]$_C"$BATTERY else @@ -126,8 +126,16 @@ update_prompt() BATTERY="$C_$prompt_colors[bar]$_C"-"$BATTERY" else ## Battery full - BATTERY="" - BATTERYSIZE=0 + BATTERY=$(grep "^AC Power" /proc/pmu/info | cut -c26) + if [ $BATTERY -ne 0 ] + then + BATTERY="⚡" + BATTERY="$C_$prompt_colors[bar]$_C"-"$BATTERY" + BATTERYSIZE=2 + else + BATTERY="" + BATTERYSIZE=0 + fi fi fi ## Percentage -- cgit v1.2.3