LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 05:31 PM   #1
zlin50
Member
 
Registered: Jan 2006
Location: Munich
Distribution: Slackware-15.0
Posts: 43

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, 10: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, 06: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration