Skip to content

Monitor NordVPN connection status from Tmux.

License

Notifications You must be signed in to change notification settings

maxrodrigo/tmux-nordvpn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmux-nordvpn logo

NordVPN Tmux Plugin

Monitor NordVPN connection status from Tmux.

GitHub

Table of Contents

Demo

tmux-nordvpn demo

Getting Started

Installation

Tmux Plugin Manager (recommended)

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

set -g @plugin 'maxrodrigo/tmux-nordvpn'

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 repository:

git clone https://github.com/maxrodrigo/tmux-nordvpn ~/.tmux/tmux-nordvpn

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

run-shell ~/.tmux/tmux-nordvpn/nordvpn.tmux

Reload Tmux environment:

tmux source-file ~/.tmux.conf

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

Requirements

The plugin relays on the NordVPN native application to pull the current status. The command line tool is required.

NordVPN setup tutorials: https://support.nordvpn.com/FAQ/Setup-tutorials/

Usage

Add any of the supported format strings to status-right or status-left.

set -g status-right 'NordVPN: #{nordvpn_status_color}#{nordvpn_status} (#{nordvpn_country})'

Supported Format Strings

  • #{nordvpn_status} - connection status.
  • #{nordvpn_server} - current server.
  • #{nordvpn_country} - current connection country.
  • #{nordvpn_city} - current connection city.
  • #{nordvpn_ip} - current connection IP address.
  • #{nordvpn_status_color} - change foreground and background color based on the VPN status.

Options

Here are all available options with their default values.

@nordvpn_exclude_server_domain true # remove "nordvpn.com" from the server name.

@nordvpn_connected_text "Connected" # text to display when connected
@nordvpn_connecting_text "Connecting" # text to display when connecting
@nordvpn_disconnected_text "Disconnected" # text to display when disconnected

@nordvpn_connected_fg_color "green" # foreground color when connected.
@nordvpn_connecting_fg_color "yellow" # foreground color when connecting.
@nordvpn_disconnected_fg_color "red" # foreground color when disconnected.

@nordvpn_connected_bg_color "" # background color when connected.
@nordvpn_connecting_bg_color "" # background color when connecting.
@nordvpn_disconnected_bg_color "" # background color when disconnected.

Examples

# .tmux.conf
set -g @nordvpn_connected_text "c"
set -g @nordvpn_connecting_text ""
set -g @nordvpn_disconnected_text "d"

set -g status-left "#[fg=blue]vpn: #{nordvpn_status_color}#{nordvpn_status} #[fg=cyan]#{nordvpn_server}"
# .tmux.conf
set -g @nordvpn_connected_text "Connected to"
set -g @nordvpn_connecting_text "Connecting to"

set -g status-left "NordVPN #{nordvpn_status_color}#{nordvpn_status} #{nordvpn_city}, #{nordvpn_country} [#{nordvpn_ip}]"

Status Update Interval

Status update won't be instant. The duration depends on the status-interval Tmux option. You can set status-interval to a low number to make the refresh faster.

set -g status-interval 5

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

The best way to send feedback is to file an issue at https://github.com/maxrodrigo/tmux-nordvpn/issues