View Single Post
Posts: 729 | Thanked: 155 times | Joined on Dec 2009
#44
Originally Posted by Snafu View Post
First of all: Thank you fnordianslip and rcull for your wonderful work here.


Of yourse you can see the Information on the status bar. But unfortunatly it is not very acurate (with just 8 Bars)



And Jaysire is using a second script and a temporary file to update the info.

Before finding this thread I thought about a similar solution. I just added
Code:
${color yellow}Battery:$color ${goto 110}${color red}${execi 30 if [ "`hal-device bme |grep "is_charging\|is_discharging" |awk '{print $3;}' |sed -e :a -e '$!N;s/\n/ /;ta'`" = "false true" ]; then  echo "Charging!"; fi}$color${goto 310}${execi 30 hal-device bme |grep "percentage" |awk '{print $3;}'}%${goto 350}${color green}${execibar 30 hal-device bme |grep "percentage" |awk '{print $3;}'} 





.
to my config, just underneath the SWAP-Info.

This displays the string "Charging!" if the battery is being charged (and not just connected to the PC/Power together wit the percentage and a bar. (see screenshot)
The information is updated every 30 sec to save CPU-Cycles.

The only thing I miss is the option "default_bar_size" which is not available in the current build. With this option the bar would be the right size.

Have fun!
It doesn't work for me if it is charging (displays an empty bar and no "Charging!" message) and I would like to fill the lower right area which is currently unused for this.
How can I do that?

Only the following works (without the charging) and the bar is smaller than the others:

Code:
${color lightgrey}Name                  PID   CPU%   MEM%			${goto 380}${color yellow}Battery: ${execi 60 hal-device | grep percen | awk '{print $3"%"}'}
${color #ff6000} ${top name 1}    ${top pid 1} ${top cpu 1} ${top mem 1}     ${goto 380}${color green}${execibar 60 hal-device bme |grep "percentage" |awk '{print $3;}'}

Last edited by DaSilva; 2010-01-04 at 10:12.