The Barista Logo

barista

An i3status alternative in golang

Download sample-bar Download i3status example View on GitHub

Volume

godoc
import "barista.run/modules/volume"

Show volume for an ALSA device: volume.Mixer(card, mixer string) / volume.DefaultMixer().
Show volume for a PulseAudio device (using D-Bus): volume.Sink(string) / volume.DefaultSink().

Configuration

Example

V:065
V:MUT

Show the volume percentage (or “MUT”):

volume.DefaultMixer().Output(func(v volume.Volume) bar.Output {
	if v.Mute {
		return outputs.Text("V:MUT")
	}
	return outputs.Textf("V:%03d", v.Pct())
})

Data: type Volume struct

Fields

Methods

Controller Methods

In addition to the data methods listed above, volume also provides controller methods to set the volume state: