i3 / i3/i3status

Bad %cpu_usage reported by i3 status

Open
#536 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
653
Forks
254
PR merge metrics
No merged PRs in 30d

Description

### Welcome

- [X] Yes, I'm using the latest major release or the current development version. These are the only supported versions.
- [X] Yes, I've searched similar issues and discussions on GitHub and didn't find any.

### Current Behavior

Using i3 4.23 & i3status 2.14-non-git
In my config, I display cpu_usage
As shown in picture, even when CPU usage is very High (184%+), reported value by i3 status is very low (13%):
![BugI3CPU](https://github.com/user-attachments/assets/64693296-b4e1-4076-b53e-59de5441bd07)

### Expected Behavior

Percentage of cpu reported by i3status and other system tools (top, ps, etc.) should be the same.

### Reproduction Instructions

- Use a (Intel) 16 core machine
- Configure i3status to display cpu_usage
- Run high cpu usage command (aarch64 VM in my case)
- Display cpu usage in standard linux tool (e.g. top)
- Observe that i3status reported value is incorrect

### i3 version

```text
Binary i3 version: 4.23 (2023-10-29) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.23 (2023-10-29) (pid 3187)
Loaded i3 config:
/home/guillaume.muller/.config/i3/config (main) (last modified: Fri Aug 2 14:01:42 2024, 4563044 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3
```

### Config file

```text
general {
output_format = "i3bar"
markup = pango
interval = 1
colors = false
# color_good = "#0000FF"
# color_degraded = "#00FF00"
# color_bad = "#FF0000"
}

order += "cpu_usage"
order += "load"
order += "cpu_temperature 0"
order += "memory"
order += "disk /"
order += "disk /home"
order += "ethernet _first_"
order += "wireless _first_"
#order += "volume master"
order += "battery 0"
order += "tztime local"

tztime local {
format = "🗓 %a %d %b %H:%M:%S" #  🗒 📅
}

cpu_usage {
format = " 󰻠 %usage " #  🖥 💻 🖥 🧠 %cpu0 %cpu1 %cpu2 %cpu3
max_threshold = 75
}

load {
format = " %1min " #  🖥 💻 🖥 🧠 %cpu0 %cpu1 %cpu2 %cpu3
max_threshold = 75
}

cpu_temperature 0 {
format = "  %degrees °C "
path = "/sys/class/thermal/thermal_zone8/temp"
max_threshold = 75
}

memory {
format = "  %percentage_free " #   📒 %available (%used) / %total
}

disk "/" {
format = " 󰋊 / %avail (%percentage_avail) " # 󰉉󰧯 󰋊󱁋 🖴 %availaible = for user / %free = for system
format_below_threshold = " 󰋊 / %avail (%percentage_avail) "
low_threshold = 10
threshold_type = percentage_free
prefix_type = binary # binary / decimal / custom
}

disk "/home" {
format = " 󰋊 /h %avail (%percentage_avail) " # 💾 🖴 %availaible = for user / %free = for system
format_below_threshold = " 󰋊 /h %avail (%percentage_avail) "
low_threshold = 10
threshold_type = percentage_free
prefix_type = binary # binary / decimal / custom
}

ethernet _first_ {
format_up = "󰈁 %ip" # 󰈀󰈁󰈂 🖧 🕸 🔀
format_down = "󰈂 " # 🞪 ❌ 🖧 🕸 🔀
}

# OLD wireless _first_ {
# format_up = " %essid (%quality) " # %ip
# format_down = ""
# }

wireless _first_ {
format_up = "󰤨 %ip REPLACE_ETH_SPEED" #  󰖩󰖪󱛅󱚼󰤨󰤭󰤯󰤮 Will be replaced by external ~/.config/i4status/network_load.sh script
format_down = "󰤮 REPLACE_ETH_SPEED" # 🞪 ❌ 🕸 🔀
}

# volume master {
# format = " 🔊 %volume "
# format_muted = " 🔇 Muted "
# device = "default"
# mixer = "Master"
# mixer_idx = 0
# }

# battery 0 {
# last_full_capacity = true
# format = "%status %percentage " # %remaining 
# path = "/sys/class/power_supply/BAT%d/uevent"
# format_down = " 󱉝" # 🕸  ↯⌁ 🔋 󱉝󱉞
# status_chr = " 󱟦" #  ⬆ 🔺 ⏚ ⚡ 󱟠󱟞 󱟡󱟟 󱟦󱟤  󰁺󰁼󰁾󰁿󰂁
# status_bat = " 󱟤" #  ⬇ 🔻
# status_unk = " 󰂑" #  󰂑
# status_full = " 󰁹" # ☻  󱊣󱟢 󰁹
# low_threshold = 10
# threshold_type = percentage
# integer_battery_capacity = true
# hide_seconds = true
# }

battery 0 {
format = "%status %percentage" # %remaining 
path = "/sys/class/power_supply/BAT%d/uevent"
format_down = "󱉝" # 🕸  ↯⌁ 🔋 󱉝󱉞
# color='#bf616a'
status_chr = "󱟦" #  ⬆ 🔺 ⏚ ⚡ 󱟠󱟞 󱟡󱟟 󱟦󱟤  󰁺󰁼󰁾󰁿󰂁
# color='#81a1c1'
status_bat = "󱟤" #  ⬇ 🔻
# color='#d08770'
status_unk = "󰂑" #  󰂑
# color='#bf616a'
status_full = '󰁹' # ☻  󱊣󱟢 󰁹
#color_full = '#a3be8c'
last_full_capacity = true
low_threshold = 10
threshold_type = percentage
hide_seconds = true
integer_battery_capacity = true
}
```

### Linux distribution & Version

Mint 22

### Are you using a compositor?

I don't know

### Logfile

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.