1
0
Fork 0
mirror of synced 2024-12-21 22:31:06 -05:00

removed useless tests in _battery_info()

This commit is contained in:
Gregory Pakosz 2020-07-23 12:41:12 +02:00
parent a8081d87be
commit d357ae54ee

View file

@ -284,9 +284,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# case "$_uname_s" in
# *Darwin*)
# while IFS= read -r line; do
# if [ x"$discharging" != x"true" ]; then
# discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false")
# fi
# discharging=$(printf '%s' "$line" | grep -qi "discharging" && echo "true" || echo "false")
# percentage=$(printf '%s' "$line" | grep -E -o '[0-9]+%')
# charge=$(awk -v charge="$charge" -v percentage="${percentage%%%}" 'BEGIN { print charge + percentage / 100 }')
# count=$((count + 1))
@ -298,9 +296,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# while IFS= read -r batpath; do
# grep -i -q device "$batpath/scope" 2> /dev/null && continue
#
# if [ x"$discharging" != x"true" ]; then
# discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false")
# fi
# discharging=$(grep -qi "discharging" "$batpath/status" && echo "true" || echo "false")
# bat_capacity="$batpath/capacity"
# if [ -r "$bat_capacity" ]; then
# charge=$(awk -v charge="$charge" -v capacity="$(cat "$bat_capacity")" 'BEGIN { print charge + capacity / 100 }')
@ -319,9 +315,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# *CYGWIN*|*MSYS*|*MINGW*)
# while IFS= read -r line; do
# [ -z "$line" ] && continue
# if [ x"$discharging" != x"true" ]; then
# discharging=$(printf '%s' "$line" | awk '{ s = ($1 == 1) ? "true" : "false"; print s }')
# fi
# discharging=$(printf '%s' "$line" | awk '{ s = ($1 == 1) ? "true" : "false"; print s }')
# charge=$(printf '%s' "$line" | awk -v charge="$charge" '{ print charge + $2 / 100 }')
# count=$((count + 1))
# done << EOF
@ -331,9 +325,7 @@ run -b '[ -z "#{window_active}" ] && [ -z "#{version}" ] && tmux set display-tim
# *OpenBSD*)
# for batid in 0 1 2; do
# sysctl -n "hw.sensors.acpibat$batid.raw0" 2>&1 | grep -q 'not found' && continue
# if [ x"$discharging" != x"true" ]; then
# discharging=$(sysctl -n "hw.sensors.acpibat$batid.raw0" | grep -q 1 && echo "true" || echo "false")
# fi
# discharging=$(sysctl -n "hw.sensors.acpibat$batid.raw0" | grep -q 1 && echo "true" || echo "false")
# if sysctl -n "hw.sensors.acpibat$batid" | grep -q amphour; then
# charge=$(awk -v charge="$charge" -v remaining="$(sysctl -n hw.sensors.acpibat$batid.amphour3 | cut -d' ' -f1)" -v full="$(sysctl -n hw.sensors.acpibat$batid.amphour0 | cut -d' ' -f1)" 'BEGIN { print charge + remaining / full }')
# else