0b8aa86ecb
Currently, the module cpu_usage prints %cpu0 information for the invalid %cpu placeholder (i.e. the cpu number is missing). Consider the following configuration. order += "cpu_usage" cpu_usage { format = "cpu0=%cpu0 cpu1=%cpu1 cpu=%cpu" # missing cpu number -------------------^ } The configuration above produces the output below. $ i3status -c config i3status: trying to auto-detect output_format setting i3status: auto-detected "term" cpu0=-2% cpu1=-49% cpu=-2% cpu0=06% cpu1=02% cpu=06% cpu0=05% cpu1=06% cpu=05% ... The module prints %cpu0 at the third placeholder where it should report an error. This commit fixes this behavior by initializing `number' to -1. If the cpu is missing in %cpu placeholder, the sscanf function does not set `number'. Because `number' is -1 (lower to 0), an error is reported and the placeholder is skipped. $ i3status -c ./config i3status: trying to auto-detect output_format setting i3status: auto-detected "term" provided CPU number '-1' above detected number of CPU 4 cpu0= cpu1=-48% cpu= provided CPU number '-1' above detected number of CPU 4 cpu0= cpu1=11% cpu= provided CPU number '-1' above detected number of CPU 4 cpu0= cpu1=03% cpu= ... |
||
---|---|---|
contrib | ||
include | ||
man | ||
src | ||
testcases | ||
travis | ||
yajl-fallback/yajl | ||
.clang-format | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG | ||
CONTRIBUTING.md | ||
i3status.c | ||
i3status.conf | ||
I3STATUS_VERSION | ||
LICENSE | ||
Makefile | ||
README.md |
i3status
Description
i3status is a small program for generating a status bar for i3bar, dzen2, xmobar or similar programs. It is designed to be very efficient by issuing a very small number of system calls, as one generally wants to update such a status line every second. This ensures that even under high load, your status bar is updated correctly. Also, it saves a bit of energy by not hogging your CPU as much as spawning the corresponding amount of shell commands would.
Development
i3status has the following dependencies:
- libconfuse-dev
- libyajl-dev
- libasound2-dev
- libnl-genl-3-dev
- asciidoc (only for the documentation)
- libpulse-dev (for getting the current volume using PulseAudio)
On debian-based systems, the following line will install all requirements:
apt-get install libconfuse-dev libyajl-dev libasound2-dev libiw-dev asciidoc libpulse-dev libnl-genl-3-dev
Upstream
i3status is developed at https://github.com/i3/i3status
Compilation
Compiling is done with the usual make-line
make && sudo make install