From 749a5e97b3a8a208decee21a6310d09f61184226 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sun, 20 May 2018 14:44:47 +0000 Subject: [PATCH] [zshrc] switch from spaces to tabs --- home/.zshrc.local | 60 +++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/home/.zshrc.local b/home/.zshrc.local index 2bbddcb..53a1d59 100644 --- a/home/.zshrc.local +++ b/home/.zshrc.local @@ -28,36 +28,36 @@ alias batt="upower -i /org/freedesktop/UPower/devices/battery_BAT0|grep percenta ## Battery status (overwrites upstream function!) function batterylinux () { -GRML_BATTERY_LEVEL='' -local batteries bat capacity -batteries=( /sys/class/power_supply/BAT*(N) ) -if (( $#batteries > 0 )) ; then - for bat in $batteries ; do - if [[ -e $bat/capacity ]]; then - capacity=$(< $bat/capacity) - else - typeset -F energy_full=$(< $bat/energy_full) - typeset -F energy_now=$(< $bat/energy_now) - typeset -i capacity=$(( 100 * $energy_now / $energy_full)) - fi - case $(< $bat/status) in - Charging) - GRML_BATTERY_LEVEL+="%F{blue}^%f" - ;; - Discharging) - if (( capacity < 20 )) ; then - GRML_BATTERY_LEVEL+="%F{red}!v%f" - else - GRML_BATTERY_LEVEL+="%F{yellow}v%f" - fi - ;; - *) # Full, Unknown - GRML_BATTERY_LEVEL+="%F{green}=%f" - ;; - esac - GRML_BATTERY_LEVEL+="${capacity}%%" - done -fi + GRML_BATTERY_LEVEL='' + local batteries bat capacity + batteries=( /sys/class/power_supply/BAT*(N) ) + if (( $#batteries > 0 )) ; then + for bat in $batteries ; do + if [[ -e $bat/capacity ]]; then + capacity=$(< $bat/capacity) + else + typeset -F energy_full=$(< $bat/energy_full) + typeset -F energy_now=$(< $bat/energy_now) + typeset -i capacity=$(( 100 * $energy_now / $energy_full)) + fi + case $(< $bat/status) in + Charging) + GRML_BATTERY_LEVEL+="%F{blue}^%f" + ;; + Discharging) + if (( capacity < 20 )) ; then + GRML_BATTERY_LEVEL+="%F{red}!v%f" + else + GRML_BATTERY_LEVEL+="%F{yellow}v%f" + fi + ;; + *) # Full, Unknown + GRML_BATTERY_LEVEL+="%F{green}=%f" + ;; + esac + GRML_BATTERY_LEVEL+="${capacity}%%" + done + fi }