Documentation
¶
Overview ¶
Package session gives lys-wm its seat: devices through logind, VT switching, and device discovery.
Index ¶
- Constants
- Variables
- func LibinputPath(getenv func(string) string) string
- func OnBattery(roots Roots) (bool, error)
- func SendHolder(fd int, m HolderMsg, fds ...int) error
- func SystemBus(getenv func(string) string) string
- type AccelProfile
- type Action
- type Area
- type Calibration
- type ClassConfig
- type ClickMethod
- type Device
- type DeviceClass
- type DeviceConfig
- type Holder
- func (h *Holder) Active() bool
- func (h *Holder) Close() error
- func (h *Holder) Commit() error
- func (h *Holder) InhibitLidSwitch() (*os.File, error)
- func (h *Holder) LidClosed() (bool, error)
- func (h *Holder) OnExit(pid int, f func())
- func (h *Holder) Open(listener Listener) error
- func (h *Holder) ReleaseDevice(d Device) error
- func (h *Holder) Seat() string
- func (h *Holder) Spawn(binary string, args []string, handover, stderr int) (int, error)
- func (h *Holder) Suspend() error
- func (h *Holder) SwitchTo(vt uint32) error
- func (h *Holder) TakeDevice(path string) (int, Device, error)
- type HolderMsg
- type HolderOp
- type InputConfig
- type InputDevice
- type Libinput
- func (in *Libinput) AddLater(path string)
- func (in *Libinput) Close() error
- func (in *Libinput) Park() error
- func (in *Libinput) Reconfigure(config InputConfig) error
- func (in *Libinput) Remove(path string)
- func (in *Libinput) ResumeLater()
- func (in *Libinput) Start(h backend.Handler)
- func (in *Libinput) Suspend()
- func (in *Libinput) Unpark() error
- type Listener
- type Logind
- func (lg *Logind) Active() bool
- func (lg *Logind) Close() error
- func (lg *Logind) CompletePause(d Device) error
- func (lg *Logind) DeferPauses()
- func (lg *Logind) InhibitLidSwitch() (*os.File, error)
- func (lg *Logind) LidClosed() (bool, error)
- func (lg *Logind) ReleaseDevice(d Device) error
- func (lg *Logind) Seat() string
- func (lg *Logind) Suspend() error
- func (lg *Logind) SwitchTo(vt uint32) error
- func (lg *Logind) TakeDevice(path string) (int, Device, error)
- type Monitor
- type NamedDeviceConfig
- type Opener
- type RaisePriority
- type Roots
- type ScrollMethod
- type Subsystem
- type TapButtonMap
- type UdevDevice
- type UdevEvent
Constants ¶
View Source
const ( MinAccelPoints = 2 MaxAccelPoints = 64 MaxAccelStep = 10000 MaxAccelPoint = 10000 )
View Source
const (
DefaultSeat = "seat0"
)
View Source
const (
HolderProtocol = 2
)
View Source
const LibinputEnv = "LYS_WM_LIBINPUT"
Variables ¶
View Source
var ( AccelFlat = AccelProfile{/* contains filtered or unexported fields */} AccelAdaptive = AccelProfile{/* contains filtered or unexported fields */} AccelProfiles = []AccelProfile{AccelFlat, AccelAdaptive} )
View Source
var ErrDeclined = errors.New("libinput does not handle the device")
View Source
var SystemRoots = Roots{Sys: "/sys", UdevData: "/run/udev/data"}
Functions ¶
func LibinputPath ¶
Types ¶
type AccelProfile ¶
type AccelProfile struct {
// contains filtered or unexported fields
}
func AccelCustom ¶
func AccelCustom(step float64, points []float64) (AccelProfile, error)
func (AccelProfile) String ¶
func (p AccelProfile) String() string
type Calibration ¶
type Calibration [6]float32
func NewCalibration ¶
func NewCalibration(m [6]float64) (Calibration, error)
type ClassConfig ¶
type ClassConfig struct {
DeviceConfig
AccelProfile AccelProfile
}
type ClickMethod ¶
type ClickMethod uint32
const ( ClickNone ClickMethod = 0 ClickButtonAreas ClickMethod = 1 << 0 ClickFinger ClickMethod = 1 << 1 )
type DeviceClass ¶
type DeviceClass uint8
const ( ClassPointer DeviceClass = iota ClassTouchpad ClassTrackpoint )
func DeviceClasses ¶
func DeviceClasses() []DeviceClass
func (DeviceClass) DefaultAccel ¶
func (c DeviceClass) DefaultAccel() AccelProfile
func (DeviceClass) String ¶
func (c DeviceClass) String() string
type DeviceConfig ¶
type DeviceConfig struct {
Tap, DragLock, NaturalScroll, DisableWhileTyping, MiddleEmulation *bool
LeftHanded, ScrollButtonLock, DisabledOnExternalMouse *bool
ClickMethod *ClickMethod
ScrollMethod *ScrollMethod
ScrollButton *uint32
TapButtonMap *TapButtonMap
AccelSpeed, ScrollFactor *float64
}
type Holder ¶
type Holder struct {
// contains filtered or unexported fields
}
func (*Holder) ReleaseDevice ¶
type HolderMsg ¶
type HolderMsg struct {
Op HolderOp `json:"op"`
ID uint64 `json:"id,omitempty"`
Path string `json:"path,omitempty"`
Binary string `json:"binary,omitempty"`
Args []string `json:"args,omitempty"`
Major uint32 `json:"major,omitempty"`
Minor uint32 `json:"minor,omitempty"`
VT uint32 `json:"vt,omitempty"`
Seat string `json:"seat,omitempty"`
On bool `json:"on,omitempty"`
PID int `json:"pid,omitempty"`
Protocol int `json:"protocol,omitempty"`
Err string `json:"err,omitempty"`
}
type HolderOp ¶
type HolderOp string
const ( OpHello HolderOp = "hello" OpOpen HolderOp = "open" OpTake HolderOp = "take" OpRelease HolderOp = "release" OpInhibit HolderOp = "inhibit" OpLid HolderOp = "lid" OpSuspend HolderOp = "suspend" OpSwitchTo HolderOp = "switch" OpSpawn HolderOp = "spawn" OpCommit HolderOp = "commit" OpPauseDone HolderOp = "pausedone" OpPaused HolderOp = "paused" OpResumed HolderOp = "resumed" OpActive HolderOp = "active" OpSleep HolderOp = "sleep" OpReply HolderOp = "reply" OpExited HolderOp = "exited" )
type InputConfig ¶
type InputConfig struct {
Classes [len(deviceClassNames)]ClassConfig
Devices map[string]NamedDeviceConfig
}
func DefaultInputConfig ¶
func DefaultInputConfig() InputConfig
type InputDevice ¶
type InputDevice struct {
// contains filtered or unexported fields
}
func (*InputDevice) Capabilities ¶
func (d *InputDevice) Capabilities() backend.Capability
func (*InputDevice) Group ¶
func (d *InputDevice) Group() uintptr
func (*InputDevice) Name ¶
func (d *InputDevice) Name() string
func (*InputDevice) Pad ¶
func (d *InputDevice) Pad() (tabletinput.PadLayout, bool)
func (*InputDevice) SetLEDs ¶
func (d *InputDevice) SetLEDs(l xkb.Locks)
func (*InputDevice) Tablet ¶
func (d *InputDevice) Tablet() (tabletinput.ID, bool)
type Libinput ¶
type Libinput struct {
// contains filtered or unexported fields
}
func OpenLibinput ¶
func OpenLibinput(l *loop.Loop, path string, opener Opener, config InputConfig, report func(error), raise RaisePriority) (*Libinput, error)
func (*Libinput) Reconfigure ¶
func (in *Libinput) Reconfigure(config InputConfig) error
func (*Libinput) ResumeLater ¶
func (in *Libinput) ResumeLater()
type Logind ¶
type Logind struct {
// contains filtered or unexported fields
}
func (*Logind) CompletePause ¶
func (*Logind) DeferPauses ¶
func (lg *Logind) DeferPauses()
func (*Logind) ReleaseDevice ¶
type NamedDeviceConfig ¶
type NamedDeviceConfig struct {
DeviceConfig
AccelProfile *AccelProfile
Calibration *Calibration
Area *Area
}
type RaisePriority ¶
type ScrollMethod ¶
type ScrollMethod uint32
const ( ScrollNone ScrollMethod = 0 ScrollTwoFinger ScrollMethod = 1 << 0 ScrollEdge ScrollMethod = 1 << 1 ScrollOnButtonDown ScrollMethod = 1 << 2 )
type TapButtonMap ¶
type TapButtonMap uint32
const ( TapLRM TapButtonMap = 0 TapLMR TapButtonMap = 1 )
func (TapButtonMap) String ¶
func (m TapButtonMap) String() string
type UdevDevice ¶
type UdevDevice struct {
Subsystem Subsystem
Syspath string
Devnode string
Device Device
Properties map[string]string
}
func Enumerate ¶
func Enumerate(roots Roots, seat string, subsystems ...Subsystem) ([]UdevDevice, error)
func (UdevDevice) BootVGA ¶
func (d UdevDevice) BootVGA() (bool, error)
func (UdevDevice) Driver ¶
func (d UdevDevice) Driver() (string, error)
Driver names the kernel driver bound to the card, "" for a card without one.
func (UdevDevice) HasRenderNode ¶
func (d UdevDevice) HasRenderNode() (bool, error)
func (UdevDevice) Seat ¶
func (d UdevDevice) Seat() string
type UdevEvent ¶
type UdevEvent struct {
Action Action
UdevDevice
}
Click to show internal directories.
Click to hide internal directories.