I3 tray monitor and cpu temperature(s)?

Hi!
I have got my old i3 / i3status configs back up and running

All seems good, but I have 2 niggles:

I have looked at the below links and searched around elsewhere, but am at a bit of a loss
https://i3wm.org/docs/userguide.html
https://i3wm.org/docs/i3status.html

  1. Tray monitor

I have:

###############        Bar         ##################
bar {
    output eDP1
    position bottom
	font pango:Noto Sans Regular 12, FontAwesome 12
    tray_output eDP1

}

bar {
# Bar hidden until press Alt
#    mode hide
#    hidden_state hide
#    modifier Mod1

    output HDMI1
    position top
	font pango:Noto Sans Regular 12, FontAwesome 12
    status_command i3status --config ~/.config/i3/i3status.conf
}

But the tray keeps appearing on HDMI1
And if I restart i3 in place it swaps between the two monitors, but not consistently

If it is relevant, in terms of order of things, I have the following in my .xprofile

# Monitors
(sleep 2 && xrandr --output eDP1 --mode 1366x768 --pos 277x1080 --output HDMI1 --primary --mode 1920x1080 --pos 0x0) &

As well as the following which start minimized in the panel/bar

# Nextcloud
sleep 1 && nextcloud &

# Enpass
sleep 1 && enpass -minimize &

# Joplin
sleep 1 && joplin-desktop &

# touchpad-indicator
touchpad-indicator &

Any ideas what I am doing wrong please?

  1. CPU Temperatures

I have:

order += "cpu_temperature 0"
order += "cpu_temperature 1"
order += "cpu_temperature 2"
order += "cpu_temperature 3"
order += "cpu_temperature 4"
order += "cpu_temperature 5"

cpu_temperature 1 {
        format = "%degrees °C"
        separator = false
}

cpu_temperature 2 {
        format = "%degrees °C"
        separator = false
}

cpu_temperature 3 {
        format = "%degrees °C"
        separator = false
}

cpu_temperature 4 {
        format = "%degrees °C"
        separator = false
}

cpu_temperature 5 {
        format = "%degrees °C"
        separator = false
}

5 gives me can’t read temp, so thats good it makes sense as my CPU has:

CPU Specifications

Total Cores 2
Total Threads 4

So I am guessing that:

(i) cpu_temperature 0 is some sort of average?

(ii) cpu_temperatures 1 to 4 are for the four threads? (I am not 100% sure of threads/cores etc, but thought each core had two threads?)

Is that right?

If so, what is the 'average? Its not a straight mean value
I am getting (‘at rest’), roughly:

cpu_temperature 0 ~ 40 to 43
cpu_temperature 1" ~ 20 (never moves at all)
cpu_temperature 2" ~ 40 to 43
cpu_temperature 3" ~ 40 to 43
cpu_temperature 4" ~ 40 to 43

so cpu 0 isnt a mean of 1 to 4

And why doesnt cpu 1 move?

EDIT - I have an onboard intel GPU and an NVIDIA GPU too (the latter of which isnt used as far as I understand)

Again, anyone shed some light on this for me please?

Thanks, as ever

maybe add ‘output eDP1’ in this section

Not sure about that, I think count starts at 0: 0 for 1, 1 for 2, 3 for 3 etc… take a look in /dev/cpu

1 Like

Check your system. i3status reads cpu temps from,

/sys/devices/platform/coretemp.0/.../tempx_input.

and,

/sys/devices/platform/coretemp.0/.../tempx_label

tells you what the temperature is for.

1 Like

Thanks, but I don’t understand - I have that in there, once to state on which monitor that bar should be, and then to to specify that the tray should be output to that same monitor (eDP1)
Could you please elaborate so that I can understand?

My bad, I didn’t read each line, on my side it works fine with i3blocks, i3status in more cryptic on my eyes

1 Like

good idea! I’ll try i3blocks
Thanks

Take a look at my config here.

1 Like

OK, I looked there and it doesnt seem to add up what i3config is doing:

leigh@archlabs /sys/devices/platform/coretemp.0/hwmon/hwmon6
 % cat temp1_label && cat temp1_input && cat temp2_label && cat temp2_input && cat temp3_label && cat temp3_input && sensors
Package id 0
38000
Core 0
38000
Core 1
36000
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +38.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +38.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +36.0°C  (high = +100.0°C, crit = +100.0°C)

nouveau-pci-0400
Adapter: PCI adapter
GPU core:         N/A  (min =  +0.60 V, max =  +1.20 V)
temp1:            N/A  (high = +95.0°C, hyst =  +3.0°C)
                       (crit = +105.0°C, hyst =  +5.0°C)
                       (emerg = +135.0°C, hyst =  +5.0°C)

BAT0-acpi-0
Adapter: ACPI interface
in0:          14.40 V  

asus-isa-0000
Adapter: ISA adapter
cpu_fan:     2100 RPM
temp1:        +38.0°C  

pch_haswell-virtual-0
Adapter: Virtual device
temp1:        +36.0°C  

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +38.0°C  (crit = +103.0°C)


Simultaneous screen shot of bar:
bar temps
where they are:


cpu_temperature 0 {
        format = "%degrees°C"
        separator = false
}

cpu_temperature 1 {
        format = "%degrees°C"
        separator = false
}

cpu_temperature 2 {
        format = "%degrees°C"
        separator = false
}

cpu_temperature 3 {
        format = "%degrees°C"
        separator = false
}

cpu_temperature 4 {
        format = "%degrees°C"
        separator = false
        separator_block_width = 10
}

So it appears that:

cpu_temperature 0 is temp1_input
cpu_temperature 2 is temp2_input
cpu_temperature 3 is temp3_input

But I have no idea where cpu_temperature 1 is coming from - its constant at 20 C

nor where cpu_temperature 4 is coming from, its 39 C in this case, which doesnt correspond to anything, but does change

EDIT: Sod it - I will just use cpu_temperature 0 :rofl:

Again, Sod it - I am going to leave it - it will be a nice little surprise to see which bar the tray appears on each time :rofl:

LOL, you only have 2 cores in the system. I am not very clear about the mapping. If you need more info, take a look at the source,

I seem to have solved the problem with the tray monitor position, but have absolutely no idea why it works

I had to put the tray_output command in the bar section of the bar on the other monitor from where I wanted the tray to appear ( believe it or not I am a native English speaker, but in my ‘defence’ I am from Essex :rofl:)

To make myself clearer, in the below example I chose to keep the tray on the eDP1 monitor

###############        Bar         ##################
bar {
    output eDP1
    position bottom
	font pango:Noto Sans Regular 12, FontAwesome 12
}

bar {
# Bar hidden until press Alt
#    mode hide
#    hidden_state hide
#    modifier Mod1

    output HDMI1
    position top
	font pango:Noto Sans Regular 12, FontAwesome 12
    tray_output eDP1
    status_command i3status --config ~/.config/i3/i3status.conf
}

For your HDMI1 monitor, try:

tray_output none

instead of another declaration of -

tray_output eDP1
1 Like

You have 2 cores and 2 GPUs
Possibly your 4 temps.

In a terminal, run:

sensors

and compare the output of sensors to the output of i3status. The sensors output should also list the chipset for the thermal indicator. I would not be surprised if the 20C temperature that never fluctuates is the Nvidia GPU you say is never used.

If you need (want) to you can run (a single line, very long):

for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done

in a terminal to match up the sensor output with hwmon for the kernel you’re using - it can change with kernel upgrades.

1 Like

Thanks, @PackRat

I did that here

Thats what I was thinking

I think I am going to do this :rofl:
backing up homer simpson GIF

1 Like

That works too:


###############        Bar         ##################
bar {
    output eDP1
    position bottom
	font pango:Noto Sans Regular 12, FontAwesome 12
    tray_output none
    status_command i3status --config ~/.config/i3/i3status2.conf
}

bar {
# Bar hidden until press Alt
#    mode hide
#    hidden_state hide
#    modifier Mod1

    output HDMI1
    position top
	font pango:Noto Sans Regular 12, FontAwesome 12
    status_command i3status --config ~/.config/i3/i3status.conf
}
1 Like

Just checking: all of that output is to the terminal isnt it? no files are changed if I run it?

1 Like

Yes, all of that is a one-line command run in your favorite terminal. No changes to your system.

It’s the command recommended by polybar devs for their temperature module ( polybar temp module)

2 Likes
leigh@archlabs ~ % for i in /sys/class/hwmon/hwmon*/temp*_input; do echo "$(<$(dirname $i)/name): $(cat ${i%_*}_label 2>/dev/null || echo $(basename ${i%_*})) $(readlink -f $i)"; done

acpitz: temp1 /sys/devices/virtual/thermal/thermal_zone0/hwmon1/temp1_input

pch_haswell: temp1 /sys/devices/virtual/thermal/thermal_zone2/hwmon3/temp1_input

nouveau: temp1 /sys/devices/pci0000:00/0000:00:1c.4/0000:04:00.0/hwmon/hwmon4/temp1_input

asus: temp1 /sys/devices/platform/asus-nb-wmi/hwmon/hwmon5/temp1_input

coretemp: Package id 0 /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input

coretemp: Core 0 /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp2_input

coretemp: Core 1 /sys/devices/platform/coretemp.0/hwmon/hwmon6/temp3_input

leigh@archlabs ~ % sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +43.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +42.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +43.0°C  (high = +100.0°C, crit = +100.0°C)

nouveau-pci-0400
Adapter: PCI adapter
GPU core:         N/A  (min =  +0.60 V, max =  +1.20 V)
temp1:            N/A  (high = +95.0°C, hyst =  +3.0°C)
                       (crit = +105.0°C, hyst =  +5.0°C)
                       (emerg = +135.0°C, hyst =  +5.0°C)

BAT0-acpi-0
Adapter: ACPI interface
in0:          14.40 V  

asus-isa-0000
Adapter: ISA adapter
cpu_fan:     2100 RPM
temp1:        +41.0°C  

pch_haswell-virtual-0
Adapter: Virtual device
temp1:        +38.5°C  

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +41.0°C  (crit = +103.0°C)

How would I see which hwmon i3status looks in?
EDIT: somewhere here I guess, but that is way way way beyond my talents

 * Reads the CPU temperature from /sys/class/thermal/thermal_zone%d/temp (or
 * the user provided path) and returns the temperature in degree celsius.

so I could put a ‘path’ line in to set it p’raps?

Seems to be these that i3config is using?

leigh@archlabs ~ % cat /sys/class/thermal/thermal_zone*/temp
42000
20000
39500
41000
42000

https://www.kernel.org/doc/html/latest/driver-api/thermal/sysfs-api.html

leigh@archlabs ~ % cat /sys/class/thermal/cooling_device*/type
Processor
Processor
Processor
Processor
intel_powerclamp

ooooooh! how interesting, blundering around finding out stuff LOL!


leigh@archlabs ~ % cat /sys/class/thermal/thermal_zone*/mode
enabled
disabled
enabled
enabled
enabled

so #2 is disabled which is pp’raps why it is 20 C and unmoving?

EDIT It seems i3blocks is the way to go if I wanted to be able to control which temps are reported but I just cant be @rsed :rofl:

Gotta learn to read the code if you really need to know the details. :grinning:

According to the code, on Linux, i3 status reads/prints the CPU temperature from “/sys/class/thermal/thermal_zoneX/temp”, although the man page suggests “/sys/devices/platform/coretemp.X/...

#define THERMAL_ZONE "/sys/class/thermal/thermal_zone%d/temp"

Here, the index ‘X’ is mapped from your configuration file, for example, “cpu_temperature 0

In other words, i3status doesn’t care what the thermal zone is for. You need to find out which zone is for your CPU. Kernel outputs the zone infomation in “/sys/class/thermal/thermal_zone%d/type” field. If the zone if for CPU, the value would be " x86_pkg_temp"

1 Like

hwmon6, temps 2&3 are your cpu cores.

2 Likes