# tmux-mem-cpu-load: one line of system load in the tmux status bar

> tmux-mem-cpu-load is an Apache-2.0 C++ program that prints memory usage, a CPU usage bar and the load average as a single line for the tmux status bar, with optional colour and powerline segment blending. The judgement is that its value is entirely in the single-line contract with tmux, and that its Windows support in the tree is the one part to check before relying on it.

**thewtex/tmux-mem-cpu-load** — CPU, RAM, and load monitor for use with tmux

- Repository: https://github.com/thewtex/tmux-mem-cpu-load
- Stars: 1,133 · Forks: 147
- Language: C++
- License: Apache-2.0
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/thewtex-tmux-mem-cpu-load

## The output is one line with seven fixed fields

tmux-mem-cpu-load is a simple, lightweight program provided for system monitoring in the status line of tmux, and the whole design is visible in a single line of output.

```
  2885/7987MB [|||||     ]  51.2% 2.11 2.35 2.44
```

The documentation annotates that line field by field. Currently used memory, available memory, the CPU usage bar graph, the CPU usage percentage, then the load average for the past minute, for the past 5 minutes and for the past 15 minutes. Seven numbers in a fixed order, which is what makes it embeddable in a status line without any parsing logic on your side.

The three components do different things. The memory monitor displays the used and available memory. The CPU usage monitor outputs a percent CPU usage over all processors and also displays a textual bar graph of the current percent usage. The system load average is displayed as well.

The CPU figure is a percent over all processors, which is a specific choice. The `-t` option changes that: mode 0 is the default, max 100 percent, and mode 1 is max 100 percent times the number of threads, so on a many-core machine a single saturated core can push the reading past 100. That is a deliberate option rather than the default, because a percentage over 100 looks like a bug in a status bar unless you know to expect it.

The memory display is likewise configurable with `-m`: mode 0 is the default, mode 1 shows free memory and mode 2 shows usage as a percentage.

## The build is CMake, and the source tree is per-platform

The build requirements are modest. CMake 3.5 or later, and a C++ compiler with C++11 support, for example gcc or g++ 4.6 or newer. The documented build sequence is:

```bash
cd <source dir>
cmake .
make
```

and installation is:

```bash
su -
make install
logout
```

The `su -` detail matters. The install writes to system locations, so it needs root, and the `logout` is there because the newly installed binary has to be on the path of the shell that will call it.

The repository layout shows how the portability is achieved. There are separate `linux/`, `osx/`, `freebsd/`, `openbsd/` and `netbsd/` directories, plus a `windows/` directory, alongside `common/` for the shared code and `builder/` for the build tooling. There is a `CMakeLists.txt` at the root and an `AUTHORS` file.

The supported platforms are named in the documentation as currently Linux, Mac OSX, FreeBSD, OpenBSD and NetBSD. The presence of a `windows/` directory in the tree is worth noticing against that list, and the documentation does not say more about it.

Packaging is available for the three major ecosystems. Gentoo has `emerge tmux-mem-cpu-load`, Homebrew has `brew install tmux-mem-cpu-load`, and FreeBSD has `pkg install tmux-mem-cpu-load`.

For tmux plugin managers, the tpm route adds a line to `.tmux.conf`:

```bash
set -g @plugin 'thewtex/tmux-mem-cpu-load'
```

And for the Antigen zsh bundle manager, the bundle is added to `.zshrc`:

```bash
antigen bundle thewtex/tmux-mem-cpu-load
```

## Wiring it into the status bar, and the interval trap

The configuration is what most people copy, and the example is worth reading carefully because it contains the one mistake that produces an empty status segment.

```bash
set -g status-interval 2
set -g status-left "#S #[fg=green,bg=black]#(tmux-mem-cpu-load --colors --interval 2)#[default]"
set -g status-left-length 60
```

The `#{...}` construct is a tmux format string that runs a shell command and substitutes its output, and the output is wrapped in tmux colour markup. The `--colors` flag is what turns on the graded colours, which the documentation says is for terminals with 256 colour support.

If you installed with tpm, you must specify the full path to the `tmux-mem-cpu-load` script, like below:

```bash
set -g status-right "#[fg=green]#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --colors --powerline-right --interval 2)#[default]"
```

The reason is that a tpm-installed plugin is not on the shell's path, so the bare command name does not resolve and the status segment comes out empty. This is the single most common failure with this plugin, and the fix is in the documentation.

There is a second trap. The interval argument to `tmux-mem-cpu-load` should be the same number of seconds that `status-interval` is set at. The two are independent mechanisms: tmux refreshes the whole status line on its own timer, and the program has its own sampling timer. If they disagree, you get output that lags behind or flickers, and the cause is not obvious from the output itself.

The status position is up to you. The documentation says to edit `$HOME/.tmux.conf` to display the program's output in status-left or status-right, and the two examples show both.

## The option set, and what the powerline blending options actually do

The full usage block lists eleven options, and they fall into three groups.

The output and display group covers the basics. `-h` or `--help` prints the help message. `-c` or `--colors` uses tmux colours in the output. `-v` or `--vertical-graph` switches the CPU graph from a horizontal bar to a vertical bar chart. `-g` or `--graph-lines` sets how many lines should be drawn in the graph, defaulting to 10, and the documentation notes that this can be set to the number of cores on a multi-core system.

The powerline group is `-p` or `--powerline-left` and `-q` or `--powerline-right`, which use powerline left and right symbols throughout the output and both enable `--colors`.

The blending group is the most interesting and the least obvious. `-l` or `--segments-left` and `-r` or `--segments-right` enable blending of the background and foreground colour, depending on whether `-p` or `-q` is used, with the segment to the left or to the right. The colour is an integer value using the standard tmux colour palette values.

The documentation explains what this is for. The `-l` and `-r` options, used together with a recent version of Tmux Powerline that has the ability to selectively disable spacing and separators between segments, allow for seamless blending of the tmux-mem-cpu-load output with other adjacent segments. The result is dynamic changing of the appropriate foreground and background colours as the start and end of the tmux-mem-cpu-load output string is aggregated with other Tmux Powerline output.

The example given is:

```bash
  tmux-mem-cpu-load -q -v -l 52 -r 33
```

The values are the standard tmux integer colour values, and they set the background and foreground colours used for the separator character so it is easy to match colouring to adjacent segments. The documentation then pairs it with a tmux-powerline theme where the neighbouring segments use matching 52 and 33 values, with `separator_disable` and `both_disable` on the relevant segments so the separators do not draw a boundary.

The last two options are for load averages. `-a` or `--averages-count` sets how many load averages should be drawn, defaulting to 3, which is why the default output shows three figures. And `-i` or `--interval` sets the tmux status refresh interval in seconds, defaulting to 1 second.

## Maintenance state and what the project does not monitor

The release history is steady and slow, which is what you would expect from a stable utility.

The three listed releases are v3.8.1 from 2024-05-22, v3.8.2 from 2025-04-16, and v3.8.3 from 2026-06-25. The last push to the repository was on 2026-08-04, and the repository is not archived.

The version scheme is minor-only within 3.8, and the gaps are around a year, which is consistent with a project that changes when something breaks rather than on a schedule.

What the program does not do is worth stating, because the feature list is short and the gaps are real. There is no disk usage, no network throughput, no per-core breakdown, no GPU, no temperature, no process list. The load average covers CPU pressure indirectly, but the percentage is an aggregate over all processors. The tool is a status line widget, not a monitoring agent.

The build configuration is also a constraint. The documented compiler baseline is C++11 with gcc or g++ 4.6, and CMake 3.5. That is deliberately old, which is good for portability to older systems and for distribution packaging, and it means the code does not use anything from newer standards. The repository also carries a `.travis.yml` alongside a GitHub Actions workflow and a CircleCI badge, which is the accumulation of several years of CI migrations that were never cleaned up.

The licence is Apache-2.0, with the `LICENSE` file at the repository root, so the code can be embedded and redistributed with attribution and the patent grant, which is a licensing observation rather than legal advice.

## Conclusion

tmux-mem-cpu-load fits a tmux user who wants memory, CPU and load in the status bar without a second plugin, and who wants the powerline segment blending options to make it match the rest of a themed status line. It does not fit a user who needs per-core CPU detail, disk or network figures, or a status bar that updates faster than the second by default, since the program polls and prints on a timer. Verify first that the plugin path in your tmux configuration resolves, which is the usual cause of an empty status segment, that the interval argument matches the `status-interval` you set, since the documentation says the two should be the same number of seconds, and that the platform you run is one of the ones the build supports, since the source tree carries separate directories for Linux, macOS, the BSDs and Windows.

## FAQ

### How do I build and install tmux-mem-cpu-load?

You need CMake 3.5 or later and a C++11 compiler, then run `cmake .` and `make` in the source directory. Installation is `su -`, `make install`, `logout`, since the binary goes to a system location. On Gentoo, Homebrew and FreeBSD there are packages instead: `emerge tmux-mem-cpu-load`, `brew install tmux-mem-cpu-load` and `pkg install tmux-mem-cpu-load`.

### Why is the tmux-mem-cpu-load status segment empty after I install with tpm?

A tpm-installed plugin is not on the shell path, so the bare command does not resolve. The documentation says you must specify the full path, as in `#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --colors --powerline-right --interval 2)`.

### What do the interval and status-interval options do in tmux-mem-cpu-load?

The `-i` or `--interval` option sets the program's own status refresh interval in seconds, defaulting to 1. The documentation notes that this argument should be the same number of seconds that tmux's `status-interval` is set at, since the two are independent timers.

### What are the --segments-left and --segments-right options for?

They enable blending of the background and foreground colour with the segment to the left or right, using standard tmux integer colour palette values. With a recent Tmux Powerline that can disable spacing and separators between segments, this lets the tmux-mem-cpu-load output blend into adjacent segments for a continuous status line.

### Which platforms does tmux-mem-cpu-load support?

The documentation states that Linux, Mac OSX, FreeBSD, OpenBSD and NetBSD are currently supported, and the source tree carries separate directories for each of those plus a `windows/` directory. The build requires CMake 3.5 or later and a C++11 compiler such as gcc or g++ 4.6 or newer.

## Sources

- [Issues](https://github.com/thewtex/tmux-mem-cpu-load/issues)
- [License: Apache-2.0](https://github.com/thewtex/tmux-mem-cpu-load/blob/master/LICENSE)
- [README](https://github.com/thewtex/tmux-mem-cpu-load/blob/master/README.md)
- [Releases](https://github.com/thewtex/tmux-mem-cpu-load/releases)
- [thewtex/tmux-mem-cpu-load on GitHub](https://github.com/thewtex/tmux-mem-cpu-load)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/thewtex-tmux-mem-cpu-load
