init
This commit is contained in:
7
bin/st-bat
Executable file
7
bin/st-bat
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
VOLTAGE=$(cat /sys/class/power_supply/BAT1/voltage_now)
|
||||
CURRENT=$(cat /sys/class/power_supply/BAT1/current_now)
|
||||
POWER="$(echo "scale=2; $VOLTAGE*$CURRENT/1000000000000" | bc)W"
|
||||
CHARGE="$(cat /sys/class/power_supply/BAT*/capacity)%"
|
||||
echo "$CHARGE $POWER"
|
||||
#echo $POWER >> .power_log
|
||||
Reference in New Issue
Block a user