I am trying to customize my conky script and I ran into some challenges (technical things that are way over my head at the moment). Basically what I wanted to do is to create an exec command for my conky to run this script that I am working on.
The thing is, my laptop has 2 heads - an Intel HD4000 and an ATI Radeon 7670M card. I would like my conky to display the temperature of my Radeon card if it is selected and display something like "disabled" or something if I decide to use my Intel HD4000 graphics. Here is the script:
- Code: Select all
value1="ERROR - X needs to be running to perform AMD Overdrive(TM) commands"
command1=$(aticonfig -q --od-gettemperature > output)
value2=$(cat output)
if [$value2 -eq $value1]
then
echo $value2
else
$command1
fi
The script is really basic but to give you an overview...
"value1" is a static variable text
"command1" is the command to extract the information, particularly the temperature, of my ATI Card and outputs the details to a textfile in the same directory where the shell script is saved (later i'll just use grep to drill down the exact data I wanted to extract).
"value2" to get the value of the information contained in "output" file from the previous command.
I used an IF THEN ELSE statement for this one and I am always getting an error
I substituted "-eq" with "=="; played a lot with namespaces [ if (argument 1) (argument 2) ] vs [if (argument 1) (argument 2)] and many other spacing combinations; I also tried [ if (argument1) (argument2) then ] instead of placing "then" as listed on the codeline 4: [ERROR: command not found
By the way, if I run aticonfig command when I'm using my Intel HD4000, I get the this message
.ERROR - X needs to be running to perform AMD Overdrive(TM) commands
My bash version is
by runningGNU bash, version 4.2.49(2)-release (x86_64-mageia-linux-gnu)
- Code: Select all
bash --version
And lastly, I am using Mageia 4 64bit dualbooting with CentOS 6.5 64bit if that matters.
Please ask questions if there is something I missed.