1 package reader 2 3 import ( 4 "context" 5 6 v2 "edge-infra.dev/pkg/sds/display/k8s/apis/v2" 7 ) 8 9 // A DisplayReader is able to read the current display configuration from the host 10 // node and return it as a DisplayConfig, e.g. by making Xrandr calls to query 11 // the node and representing this as a DisplayConfig. Also returned are a slice 12 // of input devices present on the node. 13 // 14 // The relevant display manager (e.g. Xorg) must be running to be able to query the 15 // node's displays. See manager.DisplayManager. 16 type DisplayReader interface { 17 // Read reads the display configuration from the node, representing it 18 // as a DisplayConfig. Also returns a list of the input devices 19 // available to the display manager. 20 // 21 // By default the reader will query all fields of the DisplayConfig. 22 // Options can be supplied to change the querying behaviour for each 23 // field, e.g. WithDefaultDPMS() will not query the DPMS settings and 24 // return default values. 25 Read(context.Context, ...Option) (*v2.DisplayConfig, []v2.InputDeviceName, error) 26 } 27