Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  RAINBARF (1)

.ds Aq ’


rainbarf - CPU/RAM/battery stats chart bar for tmux (and GNU screen)



version 1.3


 rainbarf --tmux --width 40 --no-battery


Fancy resource usage charts to put into the tmux <> status line. The CPU utilization history chart is tinted with the following colors to reflect the system memory allocation:
o <B>greenB>: free memory;
o <B>yellowB>: active memory;
o <B>blueB>: inactive memory;
o <B>redB>: wired memory on Mac OS X / FreeBSD; unaccounted memory on Linux;
o <B>cyanB>: cached memory on Linux, buf on FreeBSD.
o <B>magentaB>: used swap memory.
If available, battery charge is displayed on the right.

Just go to <> to see some screenshots.



o Traditional way:

 perl Build.PL
 ./Build test
 ./Build install

o Homebrew <> way:

 brew install rainbarf

o MacPorts <> way:

 port install rainbarf

o CPAN way:

 cpan -i App::rainbarf

o Modern Perl way:

 cpanm git://


Add the following line to your ~/.tmux.conf file:

 set-option -g status-utf8 on
 set -g status-right #(rainbarf)

Or, under GNOME Terminal:

 set-option -g status-utf8 on
 set -g status-right #(rainbarf --rgb)

Reload the tmux config by running tmux source-file ~/.tmux.conf.


~/.rainbarf.conf can be used to persistently store OPTIONS:

 # example configuration file
 width=20   # widget width
 bolt       # fancy charging character
 remaining  # display remaining battery
 rgb        # 256-colored palette

OPTIONS specified via command line override that values. Configuration file can be specified via RAINBARF environment variable:

 RAINBARF=~/.rainbarf.conf rainbarf


--help This.
--[no]battery Display the battery charge indicator. Enabled by default.
--[no]remaining Display the time remaining until the battery is fully charged/empty. See CAVEAT. Disabled by default.
--[no]bolt Display even fancier battery indicator. Disabled by default.
--[no]bright Tricky one. Disabled by default. See CAVEAT.
--[no]rgb Use the <B>RGBB> palette instead of the system colors. Also disabled by default, for the same reasons as above.
--fg COLOR_NAME Force chart foreground color.
--bg COLOR_NAME Force chart background color.
--[no]loadavg Use load average <> metric instead of CPU utilization. You might want to set the --max threshold since this is an absolute value and has varying ranges on different systems. Disabled by default.
--[no]swap Display the swap usage. Used swap amount is added to the total amount, but the free swap amount is not! Disabled by default.
--max NUMBER Maximum loadavg you expect before rescaling the chart. Default is 1.
--order INDEXES Specify the memory usage bar order. The default is fwaic ( <B>fB>ree, <B>wB>ired, <B>aB>ctive, <B>iB>nactive & <B>cB>ached ).
--[no]tmux Force tmux colors mode. By default, rainbarf detects automatically if it is being called from tmux or from the interactive shell.
--screen screen(1) <> colors mode. Experimental. See CAVEAT.
--width NUMBER Chart width. Default is 38, so both the chart and the battery indicator fit the tmux status line. Higher values may require disabling the battery indicator or raising the status-right-length value in ~/.tmux.conf.
--datfile FILENAME Specify the file to log CPU stats to. Default: $HOME/.rainbarf.dat
--skip NUMBER Do not write CPU stats if file already exists and is newer than this many seconds. Useful if you refresh tmux status quite frequently.


    Time remaining

If the --remaining option is present but you do not see the time in your status bar, you may need to increase the value of status-right-length to 48.

    Color scheme

If you only see the memory usage bars but no CPU utilization 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 <B>brightB> attribute for greater contrast, or maybe consider switching to the 256-color palette. There are some issues with that, though:
1. Other color schemes (notably, solarized <>) have different meaning for the ANSI bright attribute. So using it will result in a quite psychedelic appearance. 256-color pallette, activated by the --rgb flag, is unaffected by that.
2. The older versions of Term::ANSIColor dependency do not recognize bright/RGB settings, falling back to the default behavior (plain 16 colors). 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 --tmux <B>is guaranteed to workB> despite the outdated Term::ANSIColor!
Another option is skipping the system colors altogether and use the <B>RGBB> palette (rainbarf --rgb). This fixes the issue 1, but doesn’t affect the issue 2. It still looks better, though.

    Persistent storage

CPU utilization stats are persistently stored in the ~/.rainbarf.dat file. Every rainbarf execution will update and rotate that file. Since tmux calls rainbarf periodically (every 15 seconds, by default), the chart will display CPU utilization for the last ~9.5 minutes (15 * 38). Thus, several tmux instances running simultaneously for the same user will result in a faster chart scrolling.


Stable screen version unfortunately has a broken UTF-8 handling specifically for the status bar. Thus, I have only tested the rainbarf with the variant from <git://>. My ~/.screenrc contents:

 backtick 1 15 15 rainbarf --bright --screen
 hardstatus string "%1`"
 hardstatus lastline


o top(1) <> is used to get the CPU/RAM stats if no /proc filesystem is available.
o ioreg(8) <> is used to get the battery status on Mac OS X.
o ACPI <> is used to get the battery status on Linux.
o Battery <> was a source of inspiration.
o Spark <> was another source of inspiration.


Stanislaw Pusep <>


o Chris Knadler <>
o Clemens Hammacher <>
o H.Merijn Brand <>
o Henrik Hodne <>
o Joe Hassick <>
o Josh Matthews <>
o Sergey Romanov <>
o Tom Cammann <>
o Tuomas Jormola <>


This software is copyright (c) 2015 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.

Search for    or go to Top of page |  Section 1 |  Main Index

perl v5.20.3 RAINBARF (1) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.