Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Conky and battery status

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
vikozo
Posts: 48
Joined: 2016-03-06 10:55
Location: suisse

Conky and battery status

#1 Post by vikozo »

Hello
i have on my Laptop Conky which Shows also the Batterie Status

Battery: ${battery_percent BAT0}% ${alignr}${battery_bar 8,70 BAT0}
and yes if works fine sofar.

But is there a possibiliti to have a Orange battery_bar if the power go out / and a green battery_bar if the battery is loading.

have a nice day
vinc

jjgomera
Posts: 9
Joined: 2013-02-05 18:05

Re: Conky and battery status

#2 Post by jjgomera »

Something like:

Battery: ${execpi 5 cat /sys/class/power_supply/BAT0/uevent | grep POWER_SUPPLY_CAPACITY= | cut -d'=' -f2 | xargs ~/Configuration/colorizebattery.sh}% ${alignr}${battery_bar 8,70 BAT0}${color}

maybe you must change the execpi command to fit to your system. It need the colorizebattery.sh script:

Code: Select all

#!/bin/bash
# colorizebattery.sh

FULL=80
FINE=40
WARM=10

if [[ $1 > $FULL ]]
   then echo "\${color green}"$1    
elif [[ $1 > $FINE ]]
   then echo "\${color yellow}"$1  
elif [[ $1 > $WARM ]]
   then echo "\${color orange}"$1 
else echo "\${color red}"$1      
fi

exit 0
Don't forget give execution flag to script:

Code: Select all

chmod +x ~/Configuration/colorizebattery.sh
You can customize the script to show more color scale.

User avatar
alan stone
Posts: 269
Joined: 2011-10-22 14:08
Location: In my body.

Re: Conky and battery status

#3 Post by alan stone »

I haven't tested it, however you might have a look here, here and here ('using lua scripts in conky' section).

margaretH
Posts: 14
Joined: 2017-01-23 20:22

Re: Conky and battery status

#4 Post by margaretH »

There is also a online documentation.
i did not look into it , only saw its listing.

Post Reply