-   Linux - Software (
-   -   conky question: passing conky-variable to shell-script (

zlin50 11-11-2009 06:31 PM

conky question: passing conky-variable to shell-script

within my conkyrc I'm using the line

${execp ~/}${battery_bar 6,120 BAT0 }$color evaluates state of charge and computes a color, giving e.g. "${color #b0ff00}" as output.

Now I would like to pass directly ${battery_percent} (which is available within conky) as input to - something like

${execp ~/ ${battery_percent}}${battery_bar 6,120 BAT0 }$color

Obviously, the above version doesn't work.
What do I have to do?


evan1026 12-29-2012 11:38 AM

I would really love an answer to this as well I'm actually trying to do pretty much the same thing so if anyone has an answer it would be nice to hear it

evan1026 12-29-2012 07:47 PM

Hey if you're still looking for something (although it's been a while, but I'm gonna post just in case) I found a command

acpi -b | egrep -o "[0-9]+%"
will return the same thing as $battery_percent, but with a percent sign, so you can use that and pass it to your shell script, just make sure you take care of the extra symbol.

All times are GMT -5. The time now is 06:39 PM.