Skip to content
Browse files

fixing issue #8

  • Loading branch information...
1 parent c11cef3 commit b5c40f1bb0ea9e2e50e43c957626e3346fc0b942 @creaktive committed Mar 7, 2013
Showing with 300 additions and 3 deletions.
  1. +0 −3 .gitignore
  2. +62 −0 META.json
  3. +37 −0 META.yml
  4. +201 −0 README
View
3 .gitignore
@@ -10,13 +10,10 @@ Build.bat
Makefile
Makefile.old
MANIFEST.bak
-META.yml
-META.json
MYMETA.json
MYMETA.yml
nytprof.out
pm_to_blib
App-rainbarf-*/*
Debian_CPANTS.txt
-README
*.tar.gz
View
62 META.json
@@ -0,0 +1,62 @@
+{
+ "abstract" : "CPU/RAM/battery stats chart bar for tmux (and GNU screen)",
+ "author" : [
+ "Stanislaw Pusep <stas@sysd.org>"
+ ],
+ "dynamic_config" : 0,
+ "generated_by" : "Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921",
+ "license" : [
+ "perl_5"
+ ],
+ "meta-spec" : {
+ "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+ "version" : "2"
+ },
+ "name" : "App-rainbarf",
+ "prereqs" : {
+ "build" : {
+ "requires" : {
+ "English" : "1.00",
+ "Test::More" : "0.45"
+ }
+ },
+ "configure" : {
+ "requires" : {
+ "Module::Build" : "0.28"
+ }
+ },
+ "runtime" : {
+ "requires" : {
+ "Getopt::Long" : "2.32",
+ "List::Util" : "1.07_00",
+ "Pod::Usage" : "1.14",
+ "Storable" : "2.04",
+ "Term::ANSIColor" : "1.04",
+ "perl" : "5.008"
+ }
+ }
+ },
+ "provides" : {
+ "App::rainbarf" : {
+ "file" : "lib/App/rainbarf.pm",
+ "version" : "0.7"
+ }
+ },
+ "release_status" : "stable",
+ "resources" : {
+ "bugtracker" : {
+ "web" : "https://github.com/creaktive/rainbarf/issues"
+ },
+ "homepage" : "https://github.com/creaktive/rainbarf",
+ "repository" : {
+ "url" : "git://github.com/creaktive/rainbarf.git"
+ }
+ },
+ "version" : "0.7",
+ "x_contributors" : [
+ "Clemens Hammacher <hammacher@cs.uni-saarland.de>",
+ "Joe Hassick <joe.hassick@gmail.com>",
+ "Tom Cammann <tom.cammann@vmci.net>",
+ "Tuomas Jormola <tj@solitudo.net>"
+ ]
+}
View
37 META.yml
@@ -0,0 +1,37 @@
+---
+abstract: 'CPU/RAM/battery stats chart bar for tmux (and GNU screen)'
+author:
+ - 'Stanislaw Pusep <stas@sysd.org>'
+build_requires:
+ English: 1.00
+ Test::More: 0.45
+configure_requires:
+ Module::Build: 0.28
+dynamic_config: 0
+generated_by: 'Module::Build version 0.4003, CPAN::Meta::Converter version 2.120921'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: App-rainbarf
+provides:
+ App::rainbarf:
+ file: lib/App/rainbarf.pm
+ version: 0.7
+requires:
+ Getopt::Long: 2.32
+ List::Util: 1.07_00
+ Pod::Usage: 1.14
+ Storable: 2.04
+ Term::ANSIColor: 1.04
+ perl: 5.008
+resources:
+ bugtracker: https://github.com/creaktive/rainbarf/issues
+ homepage: https://github.com/creaktive/rainbarf
+ repository: git://github.com/creaktive/rainbarf.git
+version: 0.7
+x_contributors:
+ - 'Clemens Hammacher <hammacher@cs.uni-saarland.de>'
+ - 'Joe Hassick <joe.hassick@gmail.com>'
+ - 'Tom Cammann <tom.cammann@vmci.net>'
+ - 'Tuomas Jormola <tj@solitudo.net>'
View
201 README
@@ -0,0 +1,201 @@
+NAME
+ rainbarf - CPU/RAM/battery stats chart bar for tmux (and GNU screen)
+
+VERSION
+ version 0.7
+
+SYNOPSIS
+ rainbarf --tmux --width 40 --no-battery
+
+DESCRIPTION
+ Fancy resource usage charts to put into the tmux
+ <http://tmux.sourceforge.net/> status line. The CPU utilization history
+ chart is tinted with the following colors to reflect the system memory
+ allocation:
+
+ * green: free memory;
+
+ * yellow: active memory;
+
+ * blue: inactive memory;
+
+ * red: wired memory on *Mac OS X* / *FreeBSD*;
+
+ * cyan: cached memory on *Linux*, buf on *FreeBSD*.
+
+ If available, battery charge is displayed on the right.
+
+ Just go to <https://github.com/creaktive/rainbarf> to see some
+ screenshots.
+
+USAGE
+ Installation
+ perl Build.PL
+ ./Build test
+ ./Build install
+
+ Configuration
+ Add the following line to your ~/.tmux.conf file:
+
+ 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".
+
+CONFIGURATION FILE
+ "~/.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.
+
+OPTIONS
+ --help
+ This.
+
+ --[no]battery
+ Display the battery charge indicator.
+
+ --[no]remaining
+ Display the time remaining until the battery is fully charged/empty.
+ See "CAVEAT".
+
+ --[no]bolt
+ Display even fancier battery indicator.
+
+ --[no]bright
+ Tricky one. Disabled by default. See "CAVEAT".
+
+ --[no]rgb
+ Use the RGB 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 <https://en.wikipedia.org/wiki/Load_(computing)>
+ 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.
+
+ --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" ( free,
+ wired, active, inactive & cached ).
+
+ --[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)
+ <http://manpages.ubuntu.com/manpages/hardy/man1/screen.1.html>
+ 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.
+
+CAVEAT
+ 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 bright attribute for greater contrast. There are
+ two issues with it, though:
+
+ 1. Other color schemes (notably, solarized
+ <http://ethanschoonover.com/solarized>) have different meaning for
+ the ANSI bright attribute. So using it will result in a quite
+ psychedelic appearance.
+
+ 2. 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 --tmux" is guaranteed to work despite
+ the outdated Term::ANSIColor!
+
+ Another option is skipping the system colors altogether and use the RGB
+ 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.
+
+ screen
+ 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://git.savannah.gnu.org/screen.git>. My
+ ~/.screenrc contents:
+
+ backtick 1 15 15 rainbarf --bright --screen
+ hardstatus string "%1`"
+ hardstatus lastline
+
+REFERENCES
+ * top(1)
+ <http://developer.apple.com/library/mac/documentation/Darwin/Referen
+ ce/ManPages/man1/top.1.html> is used to get the CPU/RAM stats if no
+ /proc filesystem is available.
+
+ * ioreg(8)
+ <http://developer.apple.com/library/mac/documentation/Darwin/Referen
+ ce/ManPages/man8/ioreg.8.html> is used to get the battery status on
+ *Mac OS X*.
+
+ * ACPI <http://www.tldp.org/howto/acpi-howto/usingacpi.html> is used
+ to get the battery status on *Linux*.
+
+ * Battery <https://github.com/Goles/Battery> was a source of
+ inspiration.
+
+ * Spark <http://zachholman.com/spark/> was another source of
+ inspiration.
+
+AUTHOR
+ Stanislaw Pusep <stas@sysd.org>
+
+CONTRIBUTORS
+ * Clemens Hammacher <https://github.com/hammacher>
+
+ * Joe Hassick <https://github.com/jh3>
+
+ * Tom Cammann <https://github.com/takac>
+
+ * Tuomas Jormola <https://github.com/tjormola>
+
+COPYRIGHT AND LICENSE
+ This software is copyright (c) 2013 by Stanislaw Pusep <stas@sysd.org>.
+
+ This is free software; you can redistribute it and/or modify it under
+ the same terms as the Perl 5 programming language system itself.
+

0 comments on commit b5c40f1

Please sign in to comment.
Something went wrong with that request. Please try again.