- Know your battery's specification :
$ cat /proc/acpi/battery/BAT0/info
- Know your current battery status :
$ cat /proc/acpi/battery/BAT0/state
NOTE: BAT0 may differ as per your Laptop model, look for what you have got in /proc/acpi/battery directory.
I have made a small script for Battery Status :
#!/bin/bashAttached the script file here
# Battery Status by GNUger
current=`grep remaining /proc/acpi/battery/BAT0/state | awk {'print $3'}`
total=`grep "design capacity:" /proc/acpi/battery/BAT0/info | awk {'print $3'}`
percent=$[100*$current/$total]
echo `grep charging /proc/acpi/battery/BAT0/state | awk {'print $3'}` $percent%
TIP: You can add this script in conkyrc file
No comments:
Post a Comment