rewrite st-power for freebsd
This commit is contained in:
@ -17,6 +17,11 @@
|
||||
#CURRENT=$(cat /sys/class/power_supply/BAT*/current_now)
|
||||
#POWER=$(echo "scale=2; $VOLTAGE*$CURRENT/1000000000000" | bc)
|
||||
|
||||
# freebsd
|
||||
#CHARGE=$(acpiconf -i 0 | grep "Remaining capacity" | awk '{print $3}')
|
||||
#POWER_RAW=$(acpiconf -i 0 | grep "Present rate:" | awk '{print $3}')
|
||||
#POWER="$(echo "scale=1; $POWER_RAW/1000" | bc)W"
|
||||
|
||||
# if it is present, just divide it to watts (from micro watts on thinkpads, perhaps something else on other platforms)
|
||||
POWER=$(cat /sys/class/power_supply/BAT*/power_now)
|
||||
POWER="$(echo "scale=2; $POWER/1000000" | bc)W"
|
||||
|
||||
Reference in New Issue
Block a user