Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Showing CPU fan speed in conky

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
TrixieTest
Posts: 11
Joined: 2023-11-17 15:56
Has thanked: 5 times

[Solved] Showing CPU fan speed in conky

#1 Post by TrixieTest »

Hello. Didn't find, how to use spoilers here, so posted just a piece of "sensors" output. I have two of the "fan1" lines, and i need to show second one in conky. Can't figure, how to do it. Can someone explain, please?

amdgpu-pci-2800
Adapter: PCI adapter
fan1: 1137 RPM (min = 0 RPM, max = 3500 RPM)

nct6797-isa-0a20
Adapter: ISA adapter
fan1: 828 RPM (min = 0 RPM)
fan2: 834 RPM (min = 0 RPM)
Last edited by TrixieTest on 2023-12-30 11:37, edited 1 time in total.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2117
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 232 times

Re: Showing CPU fan speed in conky

#2 Post by FreewheelinFrank »

Moved to programming.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2117
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 232 times

Re: Showing CPU fan speed in conky

#3 Post by FreewheelinFrank »

Conky can print the output of a command with execi, piped through awk to search for specific lines and print only specific strings from the selected line.

Compare for example output of

Code: Select all

$ xset -q
and

Code: Select all

$ xset -q | awk '/Caps/{print $2 $3 $4, $6 $7 $8}'
I can add that to Conky thus:

Code: Select all

${execi 1800 xset -q | awk '/Caps/{print $2 $3 $4, $6 $7 $8}'}

Image


You can also select by line and element with awk:

https://stackoverflow.com/questions/150 ... ent-in-awk

TrixieTest
Posts: 11
Joined: 2023-11-17 15:56
Has thanked: 5 times

Re: Showing CPU fan speed in conky

#4 Post by TrixieTest »

FreewheelinFrank wrote: 2023-12-30 10:25 Conky can print the output of a command with execi, piped through awk to search for specific lines and print only specific strings from the selected line.

Compare for example output of

Code: Select all

$ xset -q
and

Code: Select all

$ xset -q | awk '/Caps/{print $2 $3 $4, $6 $7 $8}'
I can add that to Conky thus:

Code: Select all

${execi 1800 xset -q | awk '/Caps/{print $2 $3 $4, $6 $7 $8}'}

Image


You can also select by line and element with awk:

https://stackoverflow.com/questions/150 ... ent-in-awk
Thanks! That's such a nice way. Much better then using "grep" and "cut" to show the needed values.

Code: Select all

sensors | awk 'FNR == 35 {print $2, $3}'
works like a charm.
Will update the whole config in this new way.
Last edited by TrixieTest on 2023-12-30 11:30, edited 1 time in total.

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 7 times
Been thanked: 16 times

Re: [Solved] Showing CPU fan speed in conky

#5 Post by Dai_trying »

You could try these for easier implementation (IMO)

${hwmon amdgpu fan 1}

${hwmon nct6797 fan 1}

${hwmon nct6797 fan 2}

Post Reply