📜  conky cpu 温度 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:27.655000             🧑  作者: Mango

代码示例1
Please see this thread and note the answer by JeanFI.

Basically it amounts to needing to review the hardware specification which will tell you the output that relates to the CPU.

To add the display to conky once you are aware of the value (using k10temp-pci-00c3 in this example) you would insert:

$ exec sensors | grep 'k10temp-pci-00c3' | awk '{print $3}'}
The grep pipe is used to search the output of sensors and display only information that matches.

The awk pipe is used to select the correct field from the output of sensors/grep. This means that you can substitute $3 for another value if it is not displaying the correct part (i.e $1,$2,$all).