@ dannyboy
---
@ mrpeachy - AWESOME!!!! As usual @ landwell - excellent point
---
Your sensors
playing with the 18-19 numbers - they are the start / stop characters of the cut function probably 17-19 will get you "102".Code:Core 0: +111.2°F (high = +165.2°F, crit = +212.0°F) Core 1: +113.0°F (high = +165.2°F, crit = +212.0°F)
But now another problem when 99 or less it "might" show 99. or +99 so back to mepeachys HowTo with something more in line with what landwell was getting at.
mrpeachys HowTo showed us this:
italics are mineSo the whole conky line would be:
You can make the exec an execi, perhaps with a 5 or 10 second interval (eg ${execi 10) to cut down on the CPU usage.Code:${exec sensors -f | grep -n 'Core 0' | sed -n 2p | awk -F'+' '{print $2}' | awk -F' ' '{print $1}'}
Using the above line I see in conky "32.0°C" (OK he uses °C but I've added the -f he mentioned)
mrpeachy continues:
You could change the above to:
which would just give you the number, without the decimal, i.e. "102"Code:${exec sensors -f | grep -n 'Core 0' | sed -n 2p | awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}
I'd use ${execi 10 sensors -f | ..... } for less CPU usage ... it's a matter of personal preference. If you have 4 cores and 6+GB RAM you wouldn't care.
OR goto the HowTo and learn how to use platform.
One thing to note: in /sys/device/w83697hf-isa-0290 you can use anything that ends with "_input"
I use two:
NOTE: my platform directory is different. They are on all machines. Yours from the sensors -f you showed is: w83697hf-isa-0290Code:CPU: ${platform f71882fg.2560 temp 1}° MB : ${platform f71882fg.2560 temp 2}°
... just dawned on me you don't have Core 0 or Core 1 in that directory.
I wonder if you can use:
/sys/device/coretemp-isa-0000
does that directory exist? If so maybe:
will work. I don't have an Intel CPU so I don't know.Code:${platform coretemp-isa-0000 Core 0}°
Last edited by Sector11; December 19th, 2012 at 04:18 PM.
In a terminal using the command
I get the output of:Code:sensors -f
I needed to install lm-sensors before I could use this command in the terminal.acpitz-virtual-0
Adapter: Virtual device
temp1: +121.1°F (crit = +203.0°F)
k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp: +114.8°F
Core0 Temp: +118.4°F
Core1 Temp: +120.2°F
Core1 Temp: +105.8°F
I would like to display this in conky but I am not sure how to code it in the .conkyrc file?
Does anyone have an idea how to do this?
What I am really looking for is the core0 and core1 temp in F. Here is what I have now in my .conkyrc file.
${color orange}CPU ${hr 2}$color
${freq}MHz Load: ${loadavg} Temp: ${acpitemp}
Information on my Main laptop. Information on my small laptop Dell 11 3000
Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
Machine Registered 366271, 366273, 366275.
Registered Ubuntu user number 18630. Registered Linux user number 458093.
@Sector11, mrpeachy -
Nice reference to the tutorial.
Should be able to simplify it further so that only awk is used - but that would be a question for someone like dk75.
This:
works on my system, but even that seems to be a bit on the complicated side.Code:sensors -f | awk '/Core0 Temp/ {print $3}' | awk -F'+' '{print $2}' | awk -F'.' '{print $1}'
@irv - look at Sector11's post above. The methods in mrpeachy's tutorial should get you what you want.
Last edited by landwell; December 19th, 2012 at 04:29 PM.
I used the code:
And here is what I got.Code:${exec sensors -f | grep -n 'Core 0' | sed -n 2p | awk -F'+' '{print $2}' | awk -F'.' '{print $1}'}
conky01.png conky02.png
As you can see it switches between 800 and 1800MHz and some times it is 1900MHz. As I was posting this it stopped switch.
EDIT Here is the 1900MHz.
conky03.png
Last edited by irv; December 19th, 2012 at 06:15 PM.
Information on my Main laptop. Information on my small laptop Dell 11 3000
Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
Machine Registered 366271, 366273, 366275.
Registered Ubuntu user number 18630. Registered Linux user number 458093.
^^ i agree, should be able to do it all with a single awk
this:
using grep, sed and awk twice is definitely overkillCode:${exec sensors -f | grep -n 'Core 0' | sed -n 2p | awk -F'+' '{print $2}' | awk -F' ' '{print $1}'}
i should edit my howto post with some more efficient code
dk75 has made a few posts on the subject, ill have to find them
@irv - your mhz reading switching is quite normal
its a power saving feature of your chip, 800 when not in demand, 1900 when its doing something
Information on my Main laptop. Information on my small laptop Dell 11 3000
Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
Machine Registered 366271, 366273, 366275.
Registered Ubuntu user number 18630. Registered Linux user number 458093.
Code:sensors -f | awk '/Core0 Temp/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'
legend:
match line with 'Core0 Temp' in itCode:/Core0 Temp/
removes "+" sign from substring $3 - it replaces regexp match "/\+/" ("+" sign is escaped with "\", as it is a special character in regexps), with string "" (empty) in a substring $3 ($1 = "Core0", $2="Temp")Code:gsub(/\+/,"",$3)
Since $3="+122.0°F", it removes "+" from it giving $3="122.0°F" after.
replaces regexp "/\..+/" with string "" in substring $3 (again - why not? since it is already processed by one "gsub"...)Code:gsub(/\..+/,"",$3)
in match "/\..+/" there are few special characters:
'\.' - escaped dot (dot in regexp means "any one character", escaped "dot" means just "dot")
'.+' - "dot plus" means "any one character repeated at least once" ("+" character is "repeat at least once" in regexp)
Combined, it is "dot and at least one character after".
Since $3="122.0°F", it removes ".0°F" from it, making $3="122" after.
Linux Debian Sid (Minted) x86_64/3.12.10, Conky 2.0_pre, Xorg 7.7/1.15.0, KDE 4.11.5, Lenovo T61, Intel X3100, HITACHI HTS722010K9SA00 100GB, WDC_WD5000BEVT 500GB
Linux user No.: 483055 | My Conky Pitstop corner | One4All project
I set the temperature unit to fahrenheit in my .conkyrc file and now it is displaying the temperature the way I wanted.
conky temp F.png# - temperature unit [either fahrenheit or celsius] default unit is degree Celsius.
temperature_unit fahrenheit
Information on my Main laptop. Information on my small laptop Dell 11 3000
Using a Asus 3632QM laptop with 8gig RAM, 250 SSD.
Machine Registered 366271, 366273, 366275.
Registered Ubuntu user number 18630. Registered Linux user number 458093.
Bookmarks