dryvers

package module
v0.0.0-...-1ffb822 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Dryvers

A Go library for handling drivers for various desktop/laptop hardware.

Including:

  • Battery: get the battery level and low-level warning
  • Brightness: get and set the main screen brightness

Supported systems:

  • Linux
  • BSD

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Battery

type Battery struct{}

func NewBattery

func NewBattery() *Battery

NewBattery creates a new instance of the batter driver.

func (*Battery) Get

func (b *Battery) Get() (float64, error)

Get returns the current battery level (between 0 and 1) or an error if there was a problem.

func (*Battery) IsLow

func (b *Battery) IsLow() (bool, error)

IsLow returns true if the battery is low (less than 10%) or an error if there was a problem.

func (*Battery) PluggedIn

func (b *Battery) PluggedIn() (bool, error)

type Brightness

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

Brightness is a type that handles querying screen brightness. It supports brightnessctl and xbacklight supported devices.

func NewBrightness

func NewBrightness() *Brightness

func (*Brightness) Get

func (b *Brightness) Get() (float64, error)

Get returns the current screen brightness (between 0 and 1) or an error if there was a problem.

func (*Brightness) Set

func (b *Brightness) Set(value float64) error

Set attempts to set the screen brightness - 1 for maximum and 0 for off. An error is returned in the case of a problem.

Jump to

Keyboard shortcuts

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