zshrc: drop templ/tt hash definitions
[grml-etc-core.git] / etc / zsh / zshrc
index bb0c784..a19c9ac 100644 (file)
@@ -1697,10 +1697,10 @@ fi
 
 batteryopenbsd(){
 GRML_BATTERY_LEVEL=''
-local batfull batwarn batnow num
+local bat batfull batwarn batnow num
 for num in 0 1 ; do
     bat=$(sysctl -n hw.sensors.acpibat${num})
-    if [[ ! -z $bat ]]; then
+    if [[ -n $bat ]]; then
         batfull=${"$(sysctl -n hw.sensors.acpibat${num}.amphour0)"%% *}
         batwarn=${"$(sysctl -n hw.sensors.acpibat${num}.amphour1)"%% *}
         batnow=${"$(sysctl -n hw.sensors.acpibat${num}.amphour3)"%% *}
@@ -1755,22 +1755,24 @@ batterydarwin(){
 GRML_BATTERY_LEVEL=''
 local -a table
 table=( ${$(pmset -g ps)[(w)7,8]%%(\%|);} )
-case $table[2] in
-    charging)
-        GRML_BATTERY_LEVEL+=" ^"
-        ;;
-    discharging)
-        if (( $table[1] < 20 )) ; then
-            GRML_BATTERY_LEVEL+=" !v"
-        else
-            GRML_BATTERY_LEVEL+=" v"
-        fi
-        ;;
-    *)
-        GRML_BATTERY_LEVEL+=" ="
-        ;;
-esac
-GRML_BATTERY_LEVEL+="$table[1]%%"
+if [[ -n $table[2] ]] ; then
+    case $table[2] in
+        charging)
+            GRML_BATTERY_LEVEL+=" ^"
+            ;;
+        discharging)
+            if (( $table[1] < 20 )) ; then
+                GRML_BATTERY_LEVEL+=" !v"
+            else
+                GRML_BATTERY_LEVEL+=" v"
+            fi
+            ;;
+        *)
+            GRML_BATTERY_LEVEL+=" ="
+            ;;
+    esac
+    GRML_BATTERY_LEVEL+="$table[1]%%"
+fi
 }
 
 # set variable debian_chroot if running in a chroot with /etc/debian_chroot
@@ -2409,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