LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

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

Rep: Reputation: 15
conky question: passing conky-variable to shell-script


Hi,

within my conkyrc I'm using the line

${execp ~/colorize.sh}${battery_bar 6,120 BAT0 }$color

colorize.sh 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 colorize.sh - something like

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

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

Thx,
Markus
 
Old 12-29-2012, 11:38 AM   #2
evan1026
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, 07:47 PM   #3
evan1026
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
Code:
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.
  


Reply


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 12:11 PM
Conky Script-Output Problem ganimo Linux - General 2 05-10-2009 08:15 AM
passing awk output to $variable for shell script? NewnanNOC Programming 3 10-23-2008 03:08 PM
conky question... reksav Linux - Software 1 03-28-2007 08:45 AM
Conky on Suse 10.0 - *** buffer overflow detected *** conky terminated Slidex Linux - Software 1 03-17-2006 12:50 PM


All times are GMT -5. The time now is 04:33 PM.

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