X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=d3d73b1e29fd93fe44e64b66eb78cf55398c8c64;hb=a14cb097fc8c96232a6450e5c3a565b22cca64f9;hp=3deb1e0c11cd71eeb31e4908c0214f3b315a50fe;hpb=0aea68e15d4b7cda80555c3009bb95687e4fbec3;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 3deb1e0..d3d73b1 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1729,8 +1729,8 @@ GRML_BATTERY_LEVEL='' local num local -A table for num in 0 1 ; do - table=( ${=${${${${${(M)${(f)"$(acpiconf -i $num)"}:#(State|Remaining capacity):*}%%( ##|%)}//:[ $'\t']##/@}// /-}//@/ }} ) - if [[ $table[State] != "not-present" ]] ; then + table=( ${=${${${${${(M)${(f)"$(acpiconf -i $num 2>&1)"}:#(State|Remaining capacity):*}%%( ##|%)}//:[ $'\t']##/@}// /-}//@/ }} ) + if [[ -n $table ]] && [[ $table[State] != "not-present" ]] ; then case $table[State] in *discharging*) if (( $table[Remaining-capacity] < 20 )) ; then @@ -2411,8 +2411,6 @@ hash -d linux=/lib/modules/$(command uname -r)/build/ hash -d log=/var/log hash -d slog=/var/log/syslog hash -d src=/usr/src -hash -d templ=/usr/share/doc/grml-templates -hash -d tt=/usr/share/doc/texttools-doc hash -d www=/var/www #d# end