From aea40d5681ce67580b17323f7925233ab11086ab Mon Sep 17 00:00:00 2001 From: pants Date: Tue, 6 Jan 2026 19:39:56 -0800 Subject: [PATCH] rewrite st-power for freebsd --- bin/st-power | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/st-power b/bin/st-power index 1477613..f1ad8df 100755 --- a/bin/st-power +++ b/bin/st-power @@ -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"