Permalink
Browse files

Update readme

  • Loading branch information...
1 parent f44175f commit c2ee91f6e1a2d5ce3efacf2f3c266eccd4fe6f96 @mixu committed Dec 1, 2014
Showing with 25 additions and 10 deletions.
  1. +1 −0 .npmignore
  2. +24 −10 readme.md
  3. BIN tmux.png
View
@@ -0,0 +1 @@
+tmux.png
View
@@ -8,6 +8,20 @@ Install Node, then use npm:
sudo npm install -g tmux-cpu
+## Example
+
+Here's how my tmux status bar looks like. This uses both `[tmux-cpu](https://github.com/mixu/tmux-cpu)` and `[tmux-mem](https://github.com/mixu/tmux-mem)`:
+
+![Example](https://raw.githubusercontent.com/mixu/tmux-cpu/master/tmux.png)
+
+And here is the line in `~/.tmux.conf` that invokes both commands and displays the result:
+
+```
+set-option -g status-right '#(/usr/local/bin/tmux-mem --format ":currentBytes [#[fg=:color]:spark#[default]] #[fg=:color]:percent#[default]") #(/usr/local/bin/tmux-cpu --format ":load [#[fg=:color]:spark#[default]] #[fg=:color]:percent#[default]") %H:%M %d-%b-%y'
+```
+
+You'll need to install both `tmux-cpu` and `tmux-mem` with `npm install -g` for this to work.
+
## Usage
Usage: `tmux-cpu`
@@ -23,18 +37,18 @@ Usage: `tmux-cpu`
## Custom formatting:
- The default formatting string is
- '#[fg=:color][:spark] :load :percent #[default][:spark5] :load5 :percent5 #[fg=black,bold][:spark15] :load15 :percent15'.
+The default formatting string is
+`#[fg=:color][:spark] :load :percent #[default][:spark5] :load5 :percent5 #[fg=black,bold][:spark15] :load15 :percent15`.
- You can use these tokens in the custom formatting string:
+You can use these tokens in the custom formatting string:
- - `:load`: Load average for the past minute.
- - `:load5`: Load average for the past 5 minutes.
- - `:load15`: Load average for the past 15 minutes.
- - `:percent`, `:percent5`, `:percent15`: CPU usage % for the past minute.
- - `:bar`, `:bar5`, `:bar15`: ASCII progress bar, CPU %.
- - `:spark`, `:spark5`, `:spark15`: the utf-8 spark line graphic
- - `:color`, `:color5`, `:color15`: a color (red, yellow, green) representing the percentage used (adaptive based on the percentage)
+- `:load`: Load average for the past minute.
+- `:load5`: Load average for the past 5 minutes.
+- `:load15`: Load average for the past 15 minutes.
+- `:percent`, `:percent5`, `:percent15`: CPU usage % for the past minute.
+- `:bar`, `:bar5`, `:bar15`: ASCII progress bar, CPU %.
+- `:spark`, `:spark5`, `:spark15`: the utf-8 spark line graphic (past minute, past 5 minutes, past 15 minutes)
+- `:color`, `:color5`, `:color15`: a color (red, yellow, green) representing the percentage used (adaptive based on the percentage; past minute, past 5 minutes, past 15 minutes)
Load percentages are calculated simply by dividing load average by the number of cpus.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c2ee91f

Please sign in to comment.