made battery status work from within Cygwin

This commit is contained in:
Gregory Pakosz
2015-10-30 08:53:24 +01:00
parent c66be48314
commit 1491ee1723
2 changed files with 36 additions and 1 deletions
+8 -1
View File
@@ -391,6 +391,13 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
# fi
# discharging=$(grep -qi "discharging" $batpath/status && echo "true" || echo "false")
# charge="$(cat $batnow) / $(cat $batfull)" || return
# elif [ x"${uname_s:0:6}" = x"CYGWIN" ]; then
# wmic path Win32_Battery 2>&1 | grep -q 'No Instance' && return
# discharging=$(wmic path Win32_Battery Get BatteryStatus 2>/dev/null | grep -q 1 && echo "true" || echo "false")
# percentage=$(wmic path Win32_Battery Get EstimatedChargeRemaining /format:list 2>/dev/null | grep '[^[:blank:]]' | cut -d= -f2)
# charge="${percentage} / 100"
# else
# return
# fi
#
# battery_symbol=$1
@@ -414,7 +421,7 @@ run 'for name in $(printenv | grep -Eo ^tmux_conf_[^=]+); do tmux setenv -gu $na
#
# if [ x"$battery_status" = x"1"] || [ x"$battery_status" = x"true" ] || [ x"$battery_status" = x"enabled" ] ; then
# if [ x"$discharging" = x"true" ]; then
# printf "%s " 🔋
# [ x"${uname_s:0:6}" != x"CYGWIN" ] && printf "%s " 🔋
# else
# printf "%s " ⚡
# fi