Page 1 of 1

sensors output has 2 temp1: display each

Posted: Sat Jun 30, 2012 7:09 pm
by homerscousin
My sensors output from terminal has 2 lines beginning temp1:
The first temp1: is my north bridge temp
The second temp:1 is my GPU
The 2 temp:1s are seperated by a few other lines.

I need to capture the first and ignore the second and vise versa to display these 2 temps in conky.
Thought there might be a simple way to grep a 1st, 2nd, 3rd etc instance of a word or phrase?

This is a test:

Code: Select all

 [code select all: blah blah blah]

Re: sensors output has 2 temp1: display each

Posted: Sat Jun 30, 2012 7:53 pm
by titetanium
Hi,

I have these two lines in my .conkyrc file the shows the core temps of my dual core cpus.

Code: Select all

${color2}${font StyleBats:size=16}K${color4}${font}   Temp-Core1: ${alignr}${hwmon temp 2}°C
${color2}${font StyleBats:size=16}K${color4}${font}   Temp-Core2: ${alignr}${hwmon temp 3}°C
Change Temp-Core# to the name of the sensors u want to display and change {hwmon sensors} to the sensor's name you want to track.

HTH,
titetanium

Re: sensors output has 2 temp1: display each

Posted: Sat Jun 30, 2012 9:30 pm
by homerscousin
Yeah, that's hwmon. I want to use the output from 'sensors', 2 different approaches I believe. I bet there is a way to do it with grep,sed,awk. I haven't found it yet. Thanks.