Conky Battery Info Hide/Display

Compiz, KDE, Gnome, Fluxbox, etc...

Moderator: Moderators

Post Reply
thegreg
Baby Hen
Posts: 2
Joined: Tue Nov 13, 2012 9:53

Conky Battery Info Hide/Display

Post by thegreg » Sat Nov 17, 2012 12:19

Hello, i need help. How to make conky hide battery info, when battery is not present?
This is what i have now:

${color grey}Battery ${color}${battery BAT1}
${color grey}Remain: ${color}${battery_percent BAT1}%
${color grey}Time: ${color}${battery_time BAT1}

What i want, is to hide the two last lines, when in first line battery status is "not present".

elvis
Simple Hen
Posts: 75
Joined: Sun Aug 26, 2012 22:34
Location: Italy

Re: Conky Battery Info Hide/Display

Post by elvis » Sat Nov 17, 2012 12:53

Try this one:

Code: Select all

${if_up battery} 
${color grey}Battery ${color}${battery BAT1}
${color grey}Remain: ${color}${battery_percent BAT1}%
${color grey}Time: ${color}${battery_time BAT1}
${endif}


If not working, maybe you should try the if_existing variable, but I'm not sure how to locate the effective battery path whitin /sys
Sabayon Linux LXDE 64 bit @ Lenovo ThinkPad Edge E130

Post Reply