mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 07:15:20 +05:30
update
This commit is contained in:
18
bat-status
Executable file
18
bat-status
Executable file
@@ -0,0 +1,18 @@
|
||||
#! /bin/sh
|
||||
|
||||
capacity=$(cat /sys/class/power_supply/BAT0/charge_full)
|
||||
voltage=$(cat /sys/class/power_supply/BAT0/voltage_now)
|
||||
percent=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
current=$(cat /sys/class/power_supply/BAT0/current_now)
|
||||
cap_now=$(cat /sys/class/power_supply/BAT0/charge_now)
|
||||
health="$(cat /sys/class/power_supply/BAT0/capacity_level)"
|
||||
stats="$(cat /sys/class/power_supply/BAT0/status)"
|
||||
|
||||
printf "Capacity : %.02f Ah\n" "$((capacity/1000))e-3"
|
||||
printf "Status : %s\n" "$health"
|
||||
printf "Percentage : %s\n" "$percent"
|
||||
printf "State : %s\n" "$stats"
|
||||
printf "Capacity now : %.02f Ah\n" "$((cap_now/1000))e-3"
|
||||
printf "Voltage now : %.02f V\n" "$((voltage/1000))e-3"
|
||||
printf "Current now : %.02f A\n" "$((current/1000))e-3"
|
||||
printf "Wattage now : %.02f W\n" "$(((voltage*current)/1000000))e-6"
|
||||
Reference in New Issue
Block a user