Code Monkey home page Code Monkey logo

tmux-net-speed's Introduction

tmux-net-speed

Tmux plugin to monitor upload and download speed of one or all interfaces.

Usage

Add one of the following format string to status-right tmux option.

Special Credit

This plugin is roughly based on the various plugins in https://github.com/tmux-plugins.

Formats

Shows value in either MB/s, KB/s, or B/s.

  • #{download_speed} - Shows only download speed,
  • #{upload_speed} - Shows only upload speed,
  • #{net_speed} - Shows both the upload and download speeds. Example: "D: 123 MB/s U: 25 MB/s"
  • #{ip} - Shows ip addres from selected interfaces

Past Values

Since this is a difference, the old values are stored in files in /tmp/. The user must be able to read and write to this directory.

Set Options

Set the following options in your .tmux.conf.

To change which interfaces to pull from, use a space-separated list. If not set, grabs all the interfaces listed in "/sys/class/net/"

set -g @net_speed_interfaces "eth0 eth1"

Note: ip only takes one interface

To change the formatter sting passed to printf.

set -g @download_speed_format "%10s"
set -g @upload_speed_format "%10s"
set -g @net_speed_format "D:%10s U:%10s"
set -g @net_ip_format "IP(%s): %10s" 

Installation with Tmux Plugin Manager (recommended)

Add plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin 'tmux-plugins/tmux-net-speed'

Hit prefix + I to fetch the plugin and source it.

If format strings are added to status-right, they should now be visible.

Manual Installation

Clone the repo:

$ git clone https://github.com/tmux-plugins/tmux-net-speed ~/clone/path

Add this line to the bottom of .tmux.conf:

run-shell ~/clone/path/net_speed.tmux

Reload TMUX environment (type this in terminal)

$ tmux source-file ~/.tmux.conf

If format strings are added to status-right, they should now be visible.

Storage of Past Values

This plugin stores the total output for all the interfaces in a file in /tmp/. Therefore, the current user must be able to write and read from that directory.

TODO

  • Add unit tests
  • Add error handling
  • Configure which interfaces to calculate
  • Configure format string for #{net_speed}
  • Handle other OSs (currently only supports Linux)

License

MIT

tmux-net-speed's People

Contributors

juanito87 avatar travisgoldie avatar beeryardtech avatar andruet avatar

Watchers

James Cloos avatar

Forkers

linuxiscool

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.