From a3ffa513fc50be64aa31786ac0e73d870336bcb0 Mon Sep 17 00:00:00 2001 From: Eric Phillips Date: Sun, 9 Nov 2014 20:02:34 -0700 Subject: [PATCH] added power script --- power.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 power.sh diff --git a/power.sh b/power.sh new file mode 100755 index 0000000..2fee9cf --- /dev/null +++ b/power.sh @@ -0,0 +1,22 @@ +#!/bin/bash +if `acpi -a | grep -q on` +then + echo "Â" +else + bat=`acpi -b | awk '{print $4}'` + bat="${bat%%%*}" #remove percent + if [[ $bat -gt 75 ]] + then + echo "ó" + elif [[ $bat -gt 25 ]] + then + if [[ $bat -gt 45 ]] + then + echo "ò" + else + echo "ò" $bat"%" + fi + else + echo "ñ" $bat"%" + fi +fi