Permalink
Browse files

battery status

  • Loading branch information...
1 parent 64e3a32 commit 48ba9e798f32c32166a9825a1f521949f9a37c4a @ronanguilloux committed Mar 12, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 .bashrc
View
@@ -134,4 +134,11 @@ genpasswd() {
[ "$l" == "" ] && l=20
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}
+function getBatteryDischargingStatus() {
+ bat=$(acpi --battery | awk '{ if ($3 == "Discharging,") print substr($4, 0, length($4))}');
+ if [ "$bat" != "" ];
+ then
+ echo "(⚡$bat) ";
+ fi
+}

0 comments on commit 48ba9e7

Please sign in to comment.