Documentation ¶
Index ¶
- Constants
- Variables
- func Battery(_ int64) string
- func CPUPercentBar(_ int64) string
- func CurrentTime(_ int64) string
- func Filesystem(_ int64) string
- func Memory(_ int64) string
- func Network(interval int64) string
- func Pulseaudio(update func(string))
- func Solaar(_ int64) string
- func Sound(update func(string))
- func Thermal(_ int64) string
- func Uptime(_ int64) string
- type Async
- type Basic
- type CPUDataStore
- type NetworkDataStore
- type PulseaudioClientStruct
- func (cl *PulseaudioClientStruct) DeviceActivePortUpdated(path dbus.ObjectPath, port dbus.ObjectPath)
- func (cl *PulseaudioClientStruct) DeviceMuteUpdated(path dbus.ObjectPath, muted bool)
- func (cl *PulseaudioClientStruct) DeviceVolumeUpdated(path dbus.ObjectPath, values []uint32)
- func (cl *PulseaudioClientStruct) NewPlaybackStream(path dbus.ObjectPath)
- func (cl *PulseaudioClientStruct) NewSink(_ dbus.ObjectPath)
- func (cl *PulseaudioClientStruct) PlaybackStreamRemoved(path dbus.ObjectPath)
- func (cl *PulseaudioClientStruct) SinkRemoved(_ dbus.ObjectPath)
- type PulseaudioStateStruct
- func (ps *PulseaudioStateStruct) Headphones() bool
- func (ps *PulseaudioStateStruct) Icon() string
- func (ps *PulseaudioStateStruct) Muted(muted bool)
- func (ps *PulseaudioStateStruct) Port(port dbus.ObjectPath)
- func (ps *PulseaudioStateStruct) Reset()
- func (ps *PulseaudioStateStruct) Update()
- func (ps *PulseaudioStateStruct) Volume(values []uint32)
- type SoundMPDStateStruct
- func (ms *SoundMPDStateStruct) Connect()
- func (ms *SoundMPDStateStruct) Connected() bool
- func (ms *SoundMPDStateStruct) Current() (string, string, string)
- func (ms *SoundMPDStateStruct) Disconnected() bool
- func (ms *SoundMPDStateStruct) Has(key string) bool
- func (ms *SoundMPDStateStruct) IsActive() bool
- func (ms *SoundMPDStateStruct) Parse(data []byte)
- func (ms *SoundMPDStateStruct) Reset()
- func (ms *SoundMPDStateStruct) Set(key, value string)
- func (ms *SoundMPDStateStruct) Update()
- type SoundMPRISStateStruct
- type SoundPulseaudioStateStruct
- func (ps *SoundPulseaudioStateStruct) AddStream(path dbus.ObjectPath)
- func (ps *SoundPulseaudioStateStruct) Current() (string, string, string)
- func (ps *SoundPulseaudioStateStruct) Icons() []string
- func (ps *SoundPulseaudioStateStruct) IsActive() bool
- func (ps *SoundPulseaudioStateStruct) RemoveStream(path dbus.ObjectPath)
- type SoundState
- type SoundStatesStruct
- func (sss *SoundStatesStruct) Current() (string, string, string)
- func (sss *SoundStatesStruct) Icons(current string) []string
- func (sss *SoundStatesStruct) Output() string
- func (sss *SoundStatesStruct) Player(player string) string
- func (sss *SoundStatesStruct) State(state string) string
- func (sss *SoundStatesStruct) Title(title, state string) string
Constants ¶
View Source
const (
DrawReset = "^d^"
)
Variables ¶
View Source
var ( BatteryPath = "/sys/class/power_supply" BatteryPerfect = drawColor("") BatteryGood = drawColor("#00ff00") BatteryOkay = drawColor("#ffff00") BatteryBad = drawColor("#ff8800") BatteryDead = drawColor("#ff0000") )
View Source
var ( CPUPath = "/proc/stat" CPUFile *os.File CPUData = make([]CPUDataStore, CPUCores+1) CPUBarWidth = 5 CPUBarBackground = "^c#000000^" CPUBarForeground = "^c#ff0000^" CPUBarDrawBackground = fmt.Sprintf("^r0,1,%d,%d^^f%d^", CPUBarWidth, BarHeight, CPUBarWidth+2*BarPadding) CPUBarDrawForeground = fmt.Sprintf("^r0,%s,%d,%s^^f%d^", "%d", CPUBarWidth, "%d", CPUBarWidth+2*BarPadding) CPUBARDrawLast = fmt.Sprintf("^f%d^^d^", -2*BarPadding) )
View Source
var ( FilesystemPath = "/proc/mounts" FilesystemUnits = []string{ "B", "KB", "MB", "GB", "TB", } )
View Source
var ( MemoryPath = "/proc/meminfo" MemoryFile *os.File MemoryBarWidth = 40 MemoryBarForeground = "#0000ff" MemoryBarBackground = "#000000" MemoryBarDrawBackground = fmt.Sprintf("^c%s^^r0,%d,%d,%d^", MemoryBarBackground, BarPadding, MemoryBarWidth, BarHeight) MemoryBarDrawForeground = fmt.Sprintf("^c%s^^r0,%d,%s,%d^^f%d^^d^", MemoryBarForeground, BarPadding, "%d", BarHeight, MemoryBarWidth) MemoryBarDraw = MemoryBarDrawBackground + MemoryBarDrawForeground MemoryUnits = []string{"KB", "MB", "GB"} MemoryData = map[string]int{ "MemTotal": 0, "MemFree": 0, "Shmem": 0, "Buffers": 0, "Cached": 0, "SReclaimable": 0, } )
View Source
var ( NetworkPath = "/proc/net/dev" NetworkFile *os.File NetworkData = make(map[string]*NetworkDataStore) NetworkUnits = []string{"KB", "MB"} )
View Source
var ( PulseaudioCore *pulseaudio.Object PulseaudioClient *PulseaudioClientStruct PulseaudioState = new(PulseaudioStateStruct) )
View Source
var ( SoundUpdate func(string) SoundPulseaudioState = NewSoundPulseaudioState() SoundMPDState = NewSoundMPDState() SoundMPRISState = NewSoundMPRISState() SoundStates = SoundStatesStruct{ // contains filtered or unexported fields } )
View Source
var ( SoundMPRISMatchPlayer = "" /* 152-byte string literal not displayed */ SoundMPRISMatchStream = "" /* 155-byte string literal not displayed */ )
View Source
var ( ThermalInputPattern = regexp.MustCompile(`^temp[0-9]+_input$`) ThermalPath = "/sys/class/hwmon/" ThermalPerfect = drawColor("") ThermalCold = drawColor("#0000ff") ThermalGood = drawColor("#00ff00") ThermalOkay = drawColor("#ffff00") ThermalBad = drawColor("#ff0000") )
View Source
var (
SoundMPDCommand = []byte("command_list_ok_begin\nstatus\ncurrentsong\nidle player\ncommand_list_end\n")
)
Functions ¶
func CPUPercentBar ¶
func CurrentTime ¶
func Filesystem ¶
func Pulseaudio ¶
func Pulseaudio(update func(string))
Types ¶
type CPUDataStore ¶
type CPUDataStore struct {
// contains filtered or unexported fields
}
type NetworkDataStore ¶
type NetworkDataStore struct {
// contains filtered or unexported fields
}
type PulseaudioClientStruct ¶
type PulseaudioClientStruct struct {
*pulseaudio.Client
}
func (*PulseaudioClientStruct) DeviceActivePortUpdated ¶
func (cl *PulseaudioClientStruct) DeviceActivePortUpdated(path dbus.ObjectPath, port dbus.ObjectPath)
func (*PulseaudioClientStruct) DeviceMuteUpdated ¶
func (cl *PulseaudioClientStruct) DeviceMuteUpdated(path dbus.ObjectPath, muted bool)
func (*PulseaudioClientStruct) DeviceVolumeUpdated ¶
func (cl *PulseaudioClientStruct) DeviceVolumeUpdated(path dbus.ObjectPath, values []uint32)
func (*PulseaudioClientStruct) NewPlaybackStream ¶
func (cl *PulseaudioClientStruct) NewPlaybackStream(path dbus.ObjectPath)
func (*PulseaudioClientStruct) NewSink ¶
func (cl *PulseaudioClientStruct) NewSink(_ dbus.ObjectPath)
func (*PulseaudioClientStruct) PlaybackStreamRemoved ¶
func (cl *PulseaudioClientStruct) PlaybackStreamRemoved(path dbus.ObjectPath)
func (*PulseaudioClientStruct) SinkRemoved ¶
func (cl *PulseaudioClientStruct) SinkRemoved(_ dbus.ObjectPath)
type PulseaudioStateStruct ¶
type PulseaudioStateStruct struct {
// contains filtered or unexported fields
}
func (*PulseaudioStateStruct) Headphones ¶
func (ps *PulseaudioStateStruct) Headphones() bool
func (*PulseaudioStateStruct) Icon ¶
func (ps *PulseaudioStateStruct) Icon() string
func (*PulseaudioStateStruct) Muted ¶
func (ps *PulseaudioStateStruct) Muted(muted bool)
func (*PulseaudioStateStruct) Port ¶
func (ps *PulseaudioStateStruct) Port(port dbus.ObjectPath)
func (*PulseaudioStateStruct) Reset ¶
func (ps *PulseaudioStateStruct) Reset()
func (*PulseaudioStateStruct) Update ¶
func (ps *PulseaudioStateStruct) Update()
func (*PulseaudioStateStruct) Volume ¶
func (ps *PulseaudioStateStruct) Volume(values []uint32)
type SoundMPDStateStruct ¶
func NewSoundMPDState ¶
func NewSoundMPDState() *SoundMPDStateStruct
func (*SoundMPDStateStruct) Connect ¶
func (ms *SoundMPDStateStruct) Connect()
func (*SoundMPDStateStruct) Connected ¶
func (ms *SoundMPDStateStruct) Connected() bool
func (*SoundMPDStateStruct) Current ¶
func (ms *SoundMPDStateStruct) Current() (string, string, string)
func (*SoundMPDStateStruct) Disconnected ¶
func (ms *SoundMPDStateStruct) Disconnected() bool
func (*SoundMPDStateStruct) Has ¶
func (ms *SoundMPDStateStruct) Has(key string) bool
func (*SoundMPDStateStruct) IsActive ¶
func (ms *SoundMPDStateStruct) IsActive() bool
func (*SoundMPDStateStruct) Parse ¶
func (ms *SoundMPDStateStruct) Parse(data []byte)
func (*SoundMPDStateStruct) Reset ¶
func (ms *SoundMPDStateStruct) Reset()
func (*SoundMPDStateStruct) Set ¶
func (ms *SoundMPDStateStruct) Set(key, value string)
func (*SoundMPDStateStruct) Update ¶
func (ms *SoundMPDStateStruct) Update()
type SoundMPRISStateStruct ¶
type SoundMPRISStateStruct struct {
// contains filtered or unexported fields
}
func NewSoundMPRISState ¶
func NewSoundMPRISState() *SoundMPRISStateStruct
func (*SoundMPRISStateStruct) Current ¶
func (ms *SoundMPRISStateStruct) Current() (string, string, string)
func (*SoundMPRISStateStruct) IsActive ¶
func (ms *SoundMPRISStateStruct) IsActive() bool
func (*SoundMPRISStateStruct) Metadata ¶
func (ms *SoundMPRISStateStruct) Metadata(data dbus.Variant)
func (*SoundMPRISStateStruct) State ¶
func (ms *SoundMPRISStateStruct) State(state dbus.Variant)
func (*SoundMPRISStateStruct) Stream ¶
func (ms *SoundMPRISStateStruct) Stream(data dbus.Variant)
type SoundPulseaudioStateStruct ¶
func NewSoundPulseaudioState ¶
func NewSoundPulseaudioState() *SoundPulseaudioStateStruct
func (*SoundPulseaudioStateStruct) AddStream ¶
func (ps *SoundPulseaudioStateStruct) AddStream(path dbus.ObjectPath)
func (*SoundPulseaudioStateStruct) Current ¶
func (ps *SoundPulseaudioStateStruct) Current() (string, string, string)
func (*SoundPulseaudioStateStruct) Icons ¶
func (ps *SoundPulseaudioStateStruct) Icons() []string
func (*SoundPulseaudioStateStruct) IsActive ¶
func (ps *SoundPulseaudioStateStruct) IsActive() bool
func (*SoundPulseaudioStateStruct) RemoveStream ¶
func (ps *SoundPulseaudioStateStruct) RemoveStream(path dbus.ObjectPath)
type SoundStatesStruct ¶
type SoundStatesStruct struct {
// contains filtered or unexported fields
}
func (*SoundStatesStruct) Current ¶
func (sss *SoundStatesStruct) Current() (string, string, string)
func (*SoundStatesStruct) Icons ¶
func (sss *SoundStatesStruct) Icons(current string) []string
func (*SoundStatesStruct) Output ¶
func (sss *SoundStatesStruct) Output() string
func (*SoundStatesStruct) Player ¶
func (sss *SoundStatesStruct) Player(player string) string
func (*SoundStatesStruct) State ¶
func (sss *SoundStatesStruct) State(state string) string
func (*SoundStatesStruct) Title ¶
func (sss *SoundStatesStruct) Title(title, state string) string
Click to show internal directories.
Click to hide internal directories.