wayland

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchIPLocation

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

func HandleRequest

func HandleRequest(conn net.Conn, req 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
}

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 Manager

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

func NewManager

func NewManager(display *wlclient.Display, 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 Request

type Request struct {
	ID     int                    `json:"id,omitempty"`
	Method string                 `json:"method"`
	Params map[string]interface{} `json:"params,omitempty"`
}

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"`
	IsDay          bool      `json:"isDay"`
}

type SuccessResult

type SuccessResult struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type SunTimes

type SunTimes struct {
	Sunrise time.Time
	Sunset  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