use /sys/class/power_supply/BATx/capacity when available
This commit is contained in:
parent
ea254d494f
commit
01b9b433f9
1 changed files with 12 additions and 7 deletions
15
.tmux.conf
15
.tmux.conf
|
@ -392,13 +392,18 @@ run 'cut -c3- ~/.tmux.conf | sh -s apply_configuration'
|
|||
# if [ ! -d $batpath ]; then
|
||||
# batpath=/sys/class/power_supply/BAT1
|
||||
# fi
|
||||
# batfull=$batpath/energy_full
|
||||
# batnow=$batpath/energy_now
|
||||
# if [ ! -r $batfull -o ! -r $batnow ]; then
|
||||
# discharging=$(grep -qi "discharging" $batpath/status && echo "true" || echo "false")
|
||||
# bat_capacity=$batpath/capacity
|
||||
# bat_energy_full=$batpath/energy_full
|
||||
# bat_energy_now=$batpath/energy_now
|
||||
# if [ -r "$bat_capacity" ] ; then
|
||||
# charge="$(cat $bat_capacity) / 100"
|
||||
# else
|
||||
# if [ ! -r "$bat_energy_full" -o ! -r "$bat_energy_now" ]; then
|
||||
# return
|
||||
# fi
|
||||
# discharging=$(grep -qi "discharging" $batpath/status && echo "true" || echo "false")
|
||||
# charge="$(cat $batnow) / $(cat $batfull)" || return
|
||||
# charge="$(cat $bat_energy_now) / $(cat $bat_energy_full)" || return
|
||||
# fi
|
||||
# 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")
|
||||
|
|
Loading…
Reference in a new issue