Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-11-2009, 05:31 PM   #1
LQ Newbie
Registered: Jan 2006
Distribution: slackware-10.2
Posts: 24

Rep: Reputation: 15
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?

Old 12-29-2012, 10:38 AM   #2
LQ Newbie
Registered: Dec 2012
Posts: 4

Rep: Reputation: Disabled
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
Old 12-29-2012, 06:47 PM   #3
LQ Newbie
Registered: Dec 2012
Posts: 4

Rep: Reputation: Disabled
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.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a variable from shell script to mysql query? ne00 Programming 1 06-10-2009 11:11 AM
Conky Script-Output Problem ganimo Linux - General 2 05-10-2009 07:15 AM
passing awk output to $variable for shell script? NewnanNOC Programming 3 10-23-2008 02:08 PM
conky question... reksav Linux - Software 1 03-28-2007 07:45 AM
Conky on Suse 10.0 - *** buffer overflow detected *** conky terminated Slidex Linux - Software 1 03-17-2006 11:50 AM

All times are GMT -5. The time now is 07:29 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration