rainbarf - CPU/RAM stats for TUI
rainbarf --tmux --width 40 --no-battery
Fancy resource usage charts to put into the tmux status line. The load history chart is tinted with the following colors to reflect the system memory allocation:
- green: free memory;
- red: wired memory on Mac OS X, cached memory on Linux;
- yellow: active memory;
- blue: inactive memory.
If available, battery charge is displayed on the right.
iTerm2 with solarized theme and ProFont:
Ubuntu Terminal with default settings:
rainbarf into your
Add the following line to your
set -g status-right '#(rainbarf)'
Or, under GNOME Terminal:
set -g status-right '#(rainbarf --bright)'
Reload the tmux config by running
tmux source-file ~/.tmux.conf.
Display the battery charge indicator.
Display even fancier battery indicator
Tricky one. Disabled by default. See "CAVEAT".
Force chart foreground color.
Force chart background color.
Maximum load you expect before rescaling the chart. Default is 1.
tmuxcolors mode. By default,
rainbarfdetects automatically if it is being called from
tmuxor from the interactive shell.
Chart width. Default is 38, so both the chart and the battery indicator fit the
tmuxstatus line. Higher values may require disabling the battery indicator or raising the
If you only see the memory usage bars but no load chart, that's because your terminal's color scheme need an explicit distinction between foreground and background colors. For instance, "red on red background" will be displayed as a red block on such terminals. Thus, you may need the ANSI bright attribute for greater contrast. There are two problems with it, though:
- Other color schemes (notably, solarized) have different meaning for the ANSI bright attribute. So using it will result in a quite psychedelic appearance.
- The older versions of Term::ANSIColor dependency do not recognize it at all, resulting in a confusing error message Invalid attribute name bright_yellow at ....
However, the whole Term::ANSIColor is optional, it is only required to preview the effects of the "OPTIONS" via command line before actually editing the
~/.tmux.conf. That is,
rainbarf --bright --tmuxis guaranteed to work despite the outdated Term::ANSIColor!
Load stats are persistently stored in the
rainbarf execution will update and rotate that file.
rainbarf periodically (every 15 seconds, by default), the chart will display load for the last ~9.5 minutes (15 * 38).
tmux instances running simultaneously for the same user will result in a faster chart scrolling.
uptime(1) is used to get the load stats if
vm_stat(1) is used to get the memory stats if
- ioreg(8) is used to get the battery status on Mac OS X.
- acpi(1) is used to get the battery status on Linux.
- Battery was a source of inspiration.
- Spark was another source of inspiration.
Stanislaw Pusep email@example.com
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Stanislaw Pusep.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.