module

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package module provides the logic for running each section of the i3/sway bar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg *config.Config) error

Run is the entrypoint to running a list of modules.

Types

type Battery

type Battery struct {
	// contains filtered or unexported fields
}

Battery is a module that prints the capacity of batteries. Only works on Linux.

func (*Battery) Run

func (b *Battery) Run(tx chan []i3.Block, rx chan i3.ClickEvent, c col.Color)

Run implements Module.

type Datetime

type Datetime struct {
	// For example: Local, UTC, Europe/Zurich, etc.
	Timezones []string `mapstructure:"timezones"`
	// Whether to show all timezones at once. If false, the timezones can be
	// toggled with a middle click.
	ShowAllTimezones bool `mapstructure:"show_all_timezones"`
	// contains filtered or unexported fields
}

Datetime is a module for printing the date and time.

func (*Datetime) Run

func (d *Datetime) Run(tx chan []i3.Block, rx chan i3.ClickEvent, c col.Color)

Run implements Module.

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

Memory provides information on RAM and swap usage for the system. Only works on Linux.

func (*Memory) Run

func (m *Memory) Run(tx chan []i3.Block, rx chan i3.ClickEvent, c col.Color)

Run implements Module.

type Module

type Module interface {
	Run(tx chan []i3.Block, rx chan i3.ClickEvent, c col.Color)
}

Module is a thing that can print to a block on the i3bar.

type Network

type Network struct {
	Interface *string
	Pattern   *string
	// contains filtered or unexported fields
}

Network provides IP address information for chosen network interfaces. The interface can be an exact match on the interface name or a match on a name regexp. Only works on Linux.

func (*Network) Run

func (n *Network) Run(tx chan []i3.Block, rx chan i3.ClickEvent, c col.Color)

Run implements Module.

type Text

type Text struct {
	Content string
}

Text is a module that will just print static text content.

func (*Text) Run

func (t *Text) Run(tx chan []i3.Block, rx chan i3.ClickEvent, c col.Color)

Run implements Module.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL