]> git.alrj.org Git - zsh.d.git/commitdiff
Hide potential errors from calls to acpi
authorAmand Tihon <amand.tihon@alrj.org>
Sat, 10 Apr 2010 09:53:02 +0000 (11:53 +0200)
committerAmand Tihon <amand.tihon@alrj.org>
Sat, 10 Apr 2010 09:53:02 +0000 (11:53 +0200)
S70_battery

index c361442baa7e93cd2d402d99f3332f453118e0fd..023f0042d5b018ba297f9c13645a774565ed6c3d 100644 (file)
@@ -9,10 +9,10 @@ battery_level()
   local online remaining bstatus gauge gcolor
 
   online=0
-  acpi -a | grep -q "on-line" && online=1
+  acpi -a 2> /dev/null | grep -q "on-line" && online=1
 
 
-  bstatus="$(acpi -b)"
+  bstatus="$(acpi -b 2> /dev/null)"
   remaining="$(echo ${bstatus[(w)4]} | sed -r 's/(^[0-9]+)%.*/\1/')"
 
   if [[ -z "$remaining" ]]; then