endeavouros-team / endeavouros-i3wm-setup

The beloved EndeavourOS default i3 (has gaps) theme and setup dotfile repo
GNU General Public License v3.0
434 stars 119 forks source link

temperature script: "sensors" command #107

Closed EssenSea closed 6 months ago

EssenSea commented 6 months ago

To get chips' temperature in script, "sensors -u $chip |" command is used as main way to achieve the function. the output is seems lilke due to this loop, which seems like read temp1_input as default temp indicator. while () { if (/^\s+temp1_input:\s+[+]([-]\d+.\d)/) { $temperature = $1; last; } } close(SENSORS);

here is my "sensors -u $chip" output in shell:

iwlwifi_1-virtual-0 Adapter: Virtual device temp1: temp1_input: 43.000

temp1_input is allocated to the virtual device.

I'm not familiar with programming, just could read basic bash or python script, it seems like I need some help from advanced programmers. so, Is there any way to mk temp indicator as default expected functions?Thanks

killajoe commented 6 months ago

That's may a y-X Problem... you can uncomment this line and add your chipset to be used for the temperature output: https://github.com/endeavouros-team/endeavouros-i3wm-setup/blob/e4666dec5fcba9ab29151e854a3df3107c6f76fa/etc/skel/.config/i3/i3blocks.conf#L105 as an example, on my system: sesnsors showing like this: 2024-02-26_13-35

so I add the cpu sensor name in the config for the bar/blocks

[CPU-temperature]
label=
command=~/.config/i3/scripts/temperature
interval=30
#T_WARN=70
#T_CRIT=90
SENSOR_CHIP="k10temp-pci-00c3"
# where SENSOR_CHIP can be find with sensors output
# can be used also for GPU temperature or other temperature sensors lm-sensors detects.

I see you were asking here because you were thinking there is a script issue... but best is to ask such questions at the forum or telegram.