You are not logged in.

#41 2017-01-17 20:59:27

pawel2k
Member
Registered: 2016-12-25
Posts: 53

Re: Conky config

I get the same result as you in terminal, but if i change from "core0" to "core 0" , it's still not working

Offline

#42 2017-01-17 21:04:54

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Conky config

pawel2k wrote:

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

#43 2017-01-17 21:16:01

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,013

Re: Conky config

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.  smile

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

#44 2017-01-17 21:18:51

pawel2k
Member
Registered: 2016-12-25
Posts: 53

Re: Conky config

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 big_smile

Cheers all appreciate your help

Offline

#45 2017-01-17 21:47:20

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,078
Website

Re: Conky config

sensors | awk '/Core 0/ {print $3}'

awk does pattern matching as well so no need for grep  smile

Offline

#46 2017-01-17 22:06:24

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,013

Re: Conky config

I don't have "cores" , that would make it easy.  sad

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

#47 2017-01-17 22:11:59

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,078
Website

Re: Conky config

Sector11 wrote:

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  smile

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

#48 2017-01-17 22:39:08

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Conky config

^ 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

#49 2017-01-17 23:06:34

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,013

Re: Conky config

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   big_smile


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#50 2017-01-17 23:08:34

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Conky config

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

#51 2017-01-17 23:23:39

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,013

Re: Conky config

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

#52 2017-01-17 23:57:11

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,013

Re: Conky config

Head_on_a_Stick wrote:

EDIT: so for the third line:

sensors | awk '/temp1/ {print $2}' | sed '3q;d'

I didn't see this Edit .. sad

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.  smile


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#53 2017-01-18 19:18:17

pawel2k
Member
Registered: 2016-12-25
Posts: 53

Re: Conky config

So is there an option to show 1 temperature for CPU instead of 4 cores?

Offline

#54 2017-01-18 19:33:15

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Conky config

pawel2k wrote:

So is there an option to show 1 temperature for CPU instead of 4 cores?

Add them together and divide by 4 wink


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

#55 2017-01-18 20:26:40

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,013

Re: Conky config

pawel2k wrote:

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

#56 2017-01-18 20:32:52

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,013

Re: Conky config

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

#57 2017-01-18 20:36:20

pawel2k
Member
Registered: 2016-12-25
Posts: 53

Re: Conky config

None of these work tongue
No errors in terminal btw

Offline

#58 2017-01-18 20:45:36

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,013

Re: Conky config

Try them again - I've edited an error - me and my typos   sad


also and try this (terminal):

sensors | awk '/Physical id/'

Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#59 2017-01-18 21:49:27

pawel2k
Member
Registered: 2016-12-25
Posts: 53

Re: Conky config

Still not working tongue

pawel@debian:~$ sensors | awk '/Physical id/'
Physical id 0:  +44.0°C  (high = +80.0°C, crit = +100.0°C)

Offline

#60 2017-01-18 21:57:39

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Conky config

pawel2k wrote:

Still not working tongue

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

Board footer

Powered by FluxBB