wayland

package
v0.0.0-...-f983c67 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateSunTimesWithTwilight

func CalculateSunTimesWithTwilight(lat, lon float64, date time.Time, elevTwilight, elevDaylight float64) (SunTimes, SunCondition)

func FetchIPLocation

func FetchIPLocation() (*float64, *float64, error)

func HandleRequest

func HandleRequest(conn net.Conn, req models.Request, manager *Manager)

func MemfdCreate

func MemfdCreate(name string, flags int) (int, error)

Types

type Config

type Config struct {
	Outputs           []string
	LowTemp           int
	HighTemp          int
	Latitude          *float64
	Longitude         *float64
	UseIPLocation     bool
	ManualSunrise     *time.Time
	ManualSunset      *time.Time
	ManualDuration    *time.Duration
	Gamma             float64
	Enabled           bool
	ElevationTwilight float64
	ElevationDaylight float64
}

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type GammaRamp

type GammaRamp struct {
	Red   []uint16
	Green []uint16
	Blue  []uint16
}

func GenerateGammaRamp

func GenerateGammaRamp(size uint32, temp int, gamma float64) GammaRamp

func GenerateIdentityRamp

func GenerateIdentityRamp(size uint32) GammaRamp

type GammaState

type GammaState int
const (
	StateNormal GammaState = iota
	StateTransition
	StateStatic
)

type Manager

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

func NewManager

func NewManager(display wlclient.WaylandDisplay, config Config) (*Manager, error)

func (*Manager) ClearManualTimes

func (m *Manager) ClearManualTimes()

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) GetState

func (m *Manager) GetState() State

func (*Manager) SetConfig

func (m *Manager) SetConfig(config Config) error

func (*Manager) SetEnabled

func (m *Manager) SetEnabled(enabled bool)

func (*Manager) SetGamma

func (m *Manager) SetGamma(gamma float64) error

func (*Manager) SetLocation

func (m *Manager) SetLocation(lat, lon float64) error

func (*Manager) SetManualTimes

func (m *Manager) SetManualTimes(sunrise, sunset time.Time) error

func (*Manager) SetTemperature

func (m *Manager) SetTemperature(low, high int) error

func (*Manager) SetUseIPLocation

func (m *Manager) SetUseIPLocation(use bool)

func (*Manager) Subscribe

func (m *Manager) Subscribe(id string) chan State

func (*Manager) Unsubscribe

func (m *Manager) Unsubscribe(id string)

type State

type State struct {
	Config         Config    `json:"config"`
	CurrentTemp    int       `json:"currentTemp"`
	NextTransition time.Time `json:"nextTransition"`
	SunriseTime    time.Time `json:"sunriseTime"`
	SunsetTime     time.Time `json:"sunsetTime"`
	DawnTime       time.Time `json:"dawnTime"`
	NightTime      time.Time `json:"nightTime"`
	IsDay          bool      `json:"isDay"`
	SunPosition    float64   `json:"sunPosition"`
}

type SunCondition

type SunCondition int
const (
	SunNormal SunCondition = iota
	SunMidnightSun
	SunPolarNight
)

type SunTimes

type SunTimes struct {
	Dawn    time.Time
	Sunrise time.Time
	Sunset  time.Time
	Night   time.Time
}

func CalculateSunTimes

func CalculateSunTimes(lat, lon float64, date time.Time) SunTimes

Jump to

Keyboard shortcuts

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