You are not logged in.

#1 2019-08-07 12:14:55

clusterF
Member
Registered: 2019-05-07
Posts: 176

[solved] sensors grep?

Not sure what to call this thread but im trying to make a temp gauge in conky with sensors and have got so far as per below, but would like to display the reading as a single line not 4 rows, how would i go about doing this in one command?

command so far.

sensors | grep '0:\|1:\|2:\|3:' | head -n4 | cut -c 16-23

what this does is greps multiple words or patterns needed for display from lm sensors and then uses head to print the number of lines i need and the cut them up to show below.

$ sensors | grep '0:\|1:\|2:\|3:' | head -n4 | cut -c 16-23
42.0°C 
47.0°C 
47.0°C 
50.0°C 

desired output =

42.0°C 47.0°C 47.0°C 50.0°C 

Last edited by clusterF (2019-08-07 12:45:58)


Everything not saved will be lost.

--Nintendo "Quit Screen" message

Offline

#2 2019-08-07 12:36:35

clusterF
Member
Registered: 2019-05-07
Posts: 176

Re: [solved] sensors grep?

Solved my own question with fmt command.

sensors | grep '0:\|1:\|2:\|3:' | head -n4 | cut -c 16-23 | fmt -w32

Now to see if it works in conky.

yes works.

Last edited by clusterF (2019-08-07 12:45:38)


Everything not saved will be lost.

--Nintendo "Quit Screen" message

Offline

#3 2019-08-07 14:22:38

unklar
Member
Registered: 2015-10-31
Posts: 937

Re: [solved] sensors grep?

cool!  devil

I have extended the command, where the first temperature (0:\) is the GPU.

sensors | grep '0:\|1:\|2:\|3:\|4:' | head -n5 | cut -c16-23 | fmt -w42
58.0°C 36.0°C 36.0°C 34.0°C 32.0°C

Thanks!

Offline

#4 2019-08-07 14:38:16

clusterF
Member
Registered: 2019-05-07
Posts: 176

Re: [solved] sensors grep?

^ nice smile


Everything not saved will be lost.

--Nintendo "Quit Screen" message

Offline

Board footer

Powered by FluxBB