The Barista Logo

barista

An i3status alternative in golang

Download sample-bar Download i3status example View on GitHub

VPN

godoc
import "barista.run/modules/vpn"

Show the VPN status for tun0: vpn.DefaultInterface().
Show the VPN status for a specific interface: vpn.New("tun1").

VPN shows the VPN status as one of three states: Disconnected, Coneecting, or Connected. It was written before netinfo was available, but now a superset of this module’s functionality is available in the netinfo module.

Configuration

Example

VPN
...

Show a simple “VPN” indicator:

vpn.DefaultInterface().Output(func(s vpn.State) bar.Output {
	if s.Connected() {
		return outputs.Text("VPN")
	}
	if s.Disconnected() {
		return nil
	}
	return outputs.Text("...")
})

Data: type State int

Constants

Methods