From 25b11a5fba025f599af375e4c7640c8b25a91301 Mon Sep 17 00:00:00 2001 From: Samuel Clements Date: Sun, 19 Feb 2012 18:56:08 +0000 Subject: [PATCH] Removed usless functions, made battery meter only display if the script exists --- themes/twain/prompt_twain_setup | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/themes/twain/prompt_twain_setup b/themes/twain/prompt_twain_setup index 553030df..4fbbc6b6 100644 --- a/themes/twain/prompt_twain_setup +++ b/themes/twain/prompt_twain_setup @@ -11,14 +11,12 @@ function collapse_pwd { } # Get the current battery charge +# Requires a script that returns a battery meter function battery_charge { - echo `~/bin/charge.py` 2>/dev/null -} - -# Echo a diffrent character if the current dir is a git repository -function prompt_char { - git branch >/dev/null 2>/dev/null && echo '±' && return - echo '○' + CHARGE_SCRIPT="~/bin/charge.py" + if [[ -a $CHARGE_SCRIPT ]]; then + echo `$(CHARGE_SCRIPT)` 2>/dev/null + fi } function prompt_twain_setup() {