The Barista Logo

barista

An i3status alternative in golang

Download sample-bar Download i3status example View on GitHub

Wireless

godoc
import "barista.run/modules/wlan"

Show wireless information from any interface starting with “wl”: wlan.Any(). Show wireless information for a specific interface: wlan.Named("wlp60s0").

In order to fill in additional wireless-only information, this module currently requires the /sbin/iwgetid command, which is usually in a package wireless-tools.

Configuration

Example

eduroam (10.4.0.8)
W: ...

Show the wireless network name and IP:

wlan.Any().Output(func (i wlan.Info) bar.Output {
	switch {
		case !i.Enabled():
			return nil
		case i.Connecting():
			return outputs.Text("W: ...")
		case !i.Connected():
			return outputs.Text("W: down")
		case len(i.IPs) < 1:
			return outputs.Textf("%s (...)", i.SSID)
		default:
			return outputs.Textf("%s (%s)", i.SSID, i.IPs[0])
	}
})

Data: type Info struct

Fields

Methods