From: Moviuro Date: Mon, 22 Dec 2014 09:01:34 +0000 (+0100) Subject: zshrc: Fixed OpenBSD battery function X-Git-Tag: v0.11.0~10 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=4c996b32b6e6c664b1bf07fd1ff508da4db8e2e0 zshrc: Fixed OpenBSD battery function It displayed some warnings when it couldn't access the battery information --- 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)"%% *}