App-rainbarf
view release on metacpan or search on metacpan
Specify the memory usage bar order.
The default is C<fwaic> ( B<f>ree, B<w>ired, B<a>ctive, B<i>nactive & B<c>ached ).
=item C<--[no]tmux>
Force C<tmux> colors mode.
By default, L<rainbarf> detects automatically if it is being called from C<tmux> or from the interactive shell.
=item C<--screen>
L<screen(1)|http://manpages.ubuntu.com/manpages/hardy/man1/screen.1.html> colors mode. B<Experimental>. See L</CAVEAT>.
=item C<--width NUMBER>
Chart width. Default is 38, so both the chart and the battery indicator fit the C<tmux> status line.
Higher values may require disabling the battery indicator or raising the C<status-right-length> value in F<~/.tmux.conf>.
=item C<--datfile FILENAME>
Specify the file to log CPU stats to.
Default: F<$HOME/.rainbarf.dat>
=item C<--skip NUMBER>
Do not write CPU stats if file already exists and is newer than this many seconds.
Useful if you refresh C<tmux> status quite frequently.
=back
=head1 CAVEAT
=head2 Time remaining
If the C<--remaining> option is present but you do not see the time in your status bar, you may need to increase the value of C<status-right-length> to 48.
=head2 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<bright> attribute for greater contrast, or maybe consider switching to the 256-color palette.
There are some issues with that, though:
=over 4
=item 1.
Other color schemes (notably, L<solarized|http://ethanschoonover.com/solarized>) have different meaning for the ANSI B<bright> attribute.
So using it will result in a quite psychedelic appearance.
256-color pallette, activated by the C<--rgb> flag, is unaffected by that.
=item 2.
The older versions of L<Term::ANSIColor> dependency do not recognize bright/RGB settings, falling back to the default behavior (plain 16 colors).
However, the whole L<Term::ANSIColor> is optional, it is only required to preview the effects of the L</OPTIONS> via command line before actually editing the F<~/.tmux.conf>.
That is, C<rainbarf --bright --tmux> B<is guaranteed to work> despite the outdated L<Term::ANSIColor>!
=back
Another option is skipping the system colors altogether and use the B<RGB> palette (C<rainbarf --rgb>).
This fixes the I<issue 1>, but doesn't affect the I<issue 2>.
It still looks better, though.
=head2 Persistent storage
CPU utilization stats are persistently stored in the F<~/.rainbarf.dat> file.
Every L<rainbarf> execution will update and rotate that file.
Since C<tmux> calls L<rainbarf> periodically (every 15 seconds, by default), the chart will display CPU utilization for the last ~9.5 minutes (15 * 38).
Thus, several C<tmux> instances running simultaneously for the same user will result in a faster chart scrolling.
=head2 screen
Stable C<screen> version unfortunately has a broken UTF-8 handling specifically for the status bar.
Thus, I have only tested the L<rainbarf> with the variant from L<git://git.savannah.gnu.org/screen.git>.
My F<~/.screenrc> contents:
backtick 1 15 15 rainbarf --bright --screen
hardstatus string "%1`"
hardstatus lastline
=head1 REFERENCES
=over 4
=item *
L<top(1)|http://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/top.1.html> is used to get the CPU/RAM stats if no F</proc> filesystem is available.
=item *
L<ioreg(8)|http://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/ioreg.8.html> is used to get the battery status on I<Mac OS X>.
=item *
L<ACPI|http://www.tldp.org/howto/acpi-howto/usingacpi.html> is used to get the battery status on I<Linux>.
=item *
L<Battery|https://github.com/Goles/Battery> was a source of inspiration.
=item *
L<Spark|http://zachholman.com/spark/> was another source of inspiration.
=back
=head1 AUTHOR
Stanislaw Pusep <stas@sysd.org>
=head1 CONTRIBUTORS
=over 4
=item *
L<Chris Knadler|https://github.com/cknadler>
=item *
L<cinaeco|https://github.com/cinaeco>
( run in 2.244 seconds using v1.01-cache-2.11-cpan-5a3173703d6 )