Simple daemon and cli wrapper for for NordVPN to be used in Waybar or any similar system bar.
nvpn
# or
nvpn toggle_killswitch
# or
nvpn reconnect
# or
nvpn <options for nordvpn>
In case the script is called without arguments, the connection will be toggled
by calling nordvpn connect
or nordvpn disconnect
.
In case the script is called with toggle_killswitch
as an argument, the
kill-switch functionality of nordvpn will be toggled.
In case the script is called with reconnect
as an argument, the connection will
be reset, using the same country as the endpoint.
In case the script is called with arguments (except toggle_killswitch
), all of those will be passed through to nordvpn
, also
triggering the update in the system bar module.
nvpnd
The nvpn
script should be symlinked to nvpnd
to function as a daemon. It
will output a status message upon receiving SIGUSR1
, which is automatically
handled by nvpn
.
For Waybar:
{
"custom/nordvpn": {
"exec": "/path/to/nvpnd",
"exec-on-event": false,
"on-click": "/path/to/nvpn",
"on-click-right": "/path/to/nvpn toggle_killswitch"
}
}
For changing the format, edit the nvpn::print_status
function.
You can also use other names for the script, but then the variables NVPN_CLI
and NVPN_DAEMON
should be modified in the script.
- nordvpn cli client
- awk, find (usually on your computer already)