<------------------------------------------------------------->
27 September 2023

CPU Temperature status on swaybar

       My PC is overheating a lot so i thought a something to
show the temperature was useful (Maybe there's a better way to
do this but i'm to lazy to find it :D )

Step 1: Find the file where sensor's information is

       There (probably) are numerically labeled folders named
"thermal_zone" in "/sys/class/thermal/", these folders have
(i think) the informations from your CPU sensors.
       Go to each folder and check the sensor's type with:

       $ cat type

to check if it's really the CPU (should return "x86_pkg_temp"
or something similar). If you found the correct folder, then
the "temp" file inside it has the temperature value
of your CPU, which should be like this

       $ cat temp
       37000

Step 2: Make the thing work

       Now, in your bar status script (if you don't have it,
i recommend creating one, it's useful), place:


       # x means the folder's number
       temp=$(cat /sys/class/thermal/thermal_zonex/temp)

       # You can use other units if you know how to
       # calculate them
       echo "Temp: $((temp/1000))C"


       And now it shows the temperature on the bar (i guess).

       I hope this worked for you (it probably didn't)

       Have a wonderful day :)
<------------------------------------------------------------->