Originally Posted by
PatrickMoore
is there a script i can use or a variable that will tell me how much charge time i have on my battery?
Just supplementing dmillerct's answers
For info you can't get with the conky commands you can also cat /proc/acpi/battery/BAT0/state (and while you're at it, try cat /proc/acpi/battery/BAT0/info too).
Code:
user@machine:~$ cat /proc/acpi/battery/BAT0/state
present: yes
capacity state: ok
charging state: charged
present rate: 0 mA
remaining capacity: 4417 mAh
present voltage: 12365 mV
For example (again your battery might not be BATT0):
Code:
${execi 60 cat /proc/acpi/battery/BAT0/state | grep capacity: | awk '{print $3 $4}'}
gives 4417 mAh (for me ofc )
my .conkyrc.batt :
Code:
#minimum_size 1366 768
#maximum_width 1366
gap_x 0
gap_y 2
alignment tr
update_interval 15.0
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
uppercase no
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour black
double_buffer yes
use_xft yes
xftfont Radio Space Bold:size=10
default_color 333333
TEXT
${if_match "$battery" != "not present"}${battery_percent}% ${if_match "${execi 60 cat /proc/acpi/battery/BAT0/state | grep charged | awk '{print $3}'}" != "charged"} ${execi 60 cat /proc/acpi/battery/BAT0/state | grep capacity: | awk '{print $3 $4}'} ${execi 60 cat /proc/acpi/battery/BAT0/state | grep rate: | awk '{print $3 $4}'} ${battery_time}${else}Battery Charged${endif}${else}No Battery Present${endif}
Bookmarks