From 4c996b32b6e6c664b1bf07fd1ff508da4db8e2e0 Mon Sep 17 00:00:00 2001 From: Moviuro Date: Mon, 22 Dec 2014 10:01:34 +0100 Subject: [PATCH] zshrc: Fixed OpenBSD battery function It displayed some warnings when it couldn't access the battery information --- etc/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 54572f1..cf4dd50 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1698,7 +1698,7 @@ batteryopenbsd(){ GRML_BATTERY_LEVEL='' local bat batfull batwarn batnow num for num in 0 1 ; do - bat=$(sysctl -n hw.sensors.acpibat${num}) + bat=$(sysctl -n hw.sensors.acpibat${num} 2>/dev/null) if [[ -n $bat ]]; then batfull=${"$(sysctl -n hw.sensors.acpibat${num}.amphour0)"%% *} batwarn=${"$(sysctl -n hw.sensors.acpibat${num}.amphour1)"%% *} -- 2.1.4