You are not logged in.
I get the same result as you in terminal, but if i change from "core0" to "core 0" , it's still not working
Offline
I get the same result as you in terminal, but if i change from "core0" to "core 0" , it's still not working
It should be "Core 0", not "core 0", and try using double quotes, not single.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
MY OOPS! Being an AMD guy I searched and that's what I found. But yes, is sensors says "Core 0" then that's what is needed.
Thanks for popping in damo!
EDIT:
Oh, and I use 'platform' much easier:
${color6}CPU${color} ${platform f71882fg.2560 temp 2}°
don't even need an "exec(pi)"
Last edited by Sector11 (2017-01-17 21:24:01)
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Yep it works, but it's not displaying correctly yet.
I'm going now finish my bottle of whisky, tommorow i will do some tests and let you know results
Cheers all appreciate your help
Offline
sensors | awk '/Core 0/ {print $3}'
awk does pattern matching as well so no need for grep
Offline
I don't have "cores" , that would make it easy.
17 Jan 17 @ 19:04:29 ~
$ sensors | awk '/temp1/ {print $2}'
+30.0°C
+46.0°C
+37.0°C
$ sensors | awk '/temp1/ {gsub(/\+/,"",$2); gsub(/\..+/,"",$2); print $2}'
30
46
37
but I have three 'temp1' variables
How would I awk for the 1st (30), the 2nd (46) or the 3rd (37)?
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
How would I awk for the 1st (30), the 2nd (46) or the 3rd (37)?
Not directly, that I know of.
Hopefully I am wrong about this
Some alternatives:
http://stackoverflow.com/questions/6022 … rom-a-file
EDIT: so for the third line:
sensors | awk '/temp1/ {print $2}' | sed '3q;d'
Last edited by Head_on_a_Stick (2017-01-17 22:14:09)
Offline
^ You could fill an awk array, then access the values by their index. (See BEGIN/END syntax for more complex awk structures);
Or script the whole thing and either write to a tmpfile and read line1, line2 etc; or put the values in variables which could be accessed by script parameters - "tempscript.sh 1" could echo the first temp value etc.
Or .... 8o
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
HoaS mentions "sed" ... something tells me I've been down this road before .. Teo and his weather script ... ie:
sed -n '18p' ~/1_accuweather/first_days
click -- ding ding
And there it was: ConkyPitStop - the same page I linked to before ... DUH!!!! :8
17 Jan 17 @ 19:58:52 ~
$ sensors | grep -n 'temp1' | sed -n 2p | awk -F'+' '{print $2}' | awk -F' ' '{print $1}'
46.0°C
17 Jan 17 @ 19:59:16 ~
$ sensors | grep -n 'temp1' | sed -n 1p | awk -F'+' '{print $2}' | awk -F' ' '{print $1}'
30.0°C
17 Jan 17 @ 19:59:26 ~
$ sensors | grep -n 'temp1' | sed -n 3p | awk -F'+' '{print $2}' | awk -F' ' '{print $1}'
37.0°C
OK, that's it - we're cool. How do you spell :8
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
You shouldn't need to pipe an awk to another awk.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Well, that's what was up at CPS ... is there a better way?
DUH ... up there in a previews post ... now add "sed" to that!!!!
17 Jan 17 @ 20:19:54 ~
$ sensors | awk '/temp1/ {gsub(/\+/,"",$2); gsub(/\..+/,"",$2); print $2}'
30
47
37
17 Jan 17 @ 20:20:16 ~
$ sensors | awk '/temp1/ {gsub(/\+/,"",$2); gsub(/\..+/,"",$2); print $2}'|sed -n 1p
30
17 Jan 17 @ 20:20:26 ~
$ sensors | awk '/temp1/ {gsub(/\+/,"",$2); gsub(/\..+/,"",$2); print $2}'|sed -n 2p
46
17 Jan 17 @ 20:20:30 ~
$ sensors | awk '/temp1/ {gsub(/\+/,"",$2); gsub(/\..+/,"",$2); print $2}'|sed -n 3p
37
I should think/brainstorm more often with you guys!
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
EDIT: so for the third line:
sensors | awk '/temp1/ {print $2}' | sed '3q;d'
I didn't see this Edit ..
Why the q;d ??
17 Jan 17 @ 20:54:13 ~
$ sensors | awk '/temp1/ {print $2}' | sed '3q;d'
+37.9°C
17 Jan 17 @ 20:54:17 ~
$ sensors | awk '/temp1/ {print $2}' | sed -n 3p
+37.5°C
Loving all the options now.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
So is there an option to show 1 temperature for CPU instead of 4 cores?
Offline
So is there an option to show 1 temperature for CPU instead of 4 cores?
Add them together and divide by 4
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
So is there an option to show 1 temperature for CPU instead of 4 cores?
Yes there is ... brb.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
When you did sensors you had this:
Physical id 0: +51.0°C (high = +80.0°C, crit = +100.0°C)
One of these "should"*** work:
${exec sensors | awk '/Physical id 0/ {gsub(/\+/,"",$1); gsub(/\..+/,"",$1); print $1}'}
${exec sensors | awk '/Physical id 0/ {gsub(/\+/,"",$2); gsub(/\..+/,"",$2); print $2}'}
${exec sensors | awk '/Physical id 0/ {gsub(/\+/,"",$3); gsub(/\..+/,"",$3); print $3}'}
EDIT
an idea of how it works:
18 Jan 17 @ 17:39:05 ~
$ sensors | awk '/temp2/'
temp2: +48.0°C (high = +85.0°C, hyst = +81.0°C)
18 Jan 17 @ 17:39:16 ~
$ sensors | awk '/temp2/ {print $1}'
temp2:
18 Jan 17 @ 17:39:25 ~
$ sensors | awk '/temp2/ {print $1" "$2}'
temp2: +48.0°C
18 Jan 17 @ 17:39:37 ~
$ sensors | awk '/temp2/ {print $2}'
+48.0°C
18 Jan 17 @ 17:39:45 ~
$
*** No guarantees ... But I put my money on the 2nd one.
I can not test, I don't have an Intel.
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
None of these work
No errors in terminal btw
Offline
Try them again - I've edited an error - me and my typos
also and try this (terminal):
sensors | awk '/Physical id/'
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Still not working
pawel@debian:~$ sensors | awk '/Physical id/'
Physical id 0: +44.0°C (high = +80.0°C, crit = +100.0°C)
Offline
Still not working
Why don't you learn some bash and basic awk syntax, and how to extract the values you need from the output of a command? Otherwise you asking others to do it for you. It will be valuable for you in the future when you can adjust scripts/conkys to suit your own system.
$ sensors | awk '/Physical id/'
Physical id 0: +44.0°C (high = +80.0°C, crit = +100.0°C)
You need the third field from the output (possibly 4th because I haven't tested it) ie "{print $3}", along with the previous gsub commands if you want to extract just the "44.0".
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline