made battery status work from within Cygwin
This commit is contained in:
+8
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user