Documentation
¶
Overview ¶
Package x11 captures an Xorg (or XWayland) screen with MIT-SHM: each frame is one XShmGetImage of a monitor's rectangle of the root window into shared memory, which the encoder reads in place. RandR lists the monitors and XFixes reads the cursor.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoDisplay = errors.New("x11: no X display")
ErrNoDisplay means there is no X server to talk to, or no monitor with the asked ID on it.
Functions ¶
func DPI ¶
func DPI() int
DPI is the X resource Xft.dpi, which desktops set to their scale times 96; 96 where it is not set.
func Displays ¶
Displays lists the X screen's monitors from RandR, or the whole screen as one display where RandR is missing.
Types ¶
type CursorImage ¶
type CursorImage struct {
X, Y, W, H, HotX, HotY int
// Serial changes as the cursor changes shape.
Serial uint64
// ARGB holds W*H pixels, premultiplied as XFixes gives them.
ARGB []uint32
}
CursorImage is the cursor's image from XFixes.
func Cursor ¶
func Cursor(withPixels bool) (CursorImage, error)
Cursor reads the cursor's image, with pixels when withPixels is set.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source captures one monitor of the X screen at a fixed rate.
func Open ¶
Open captures the monitor with this ID (a RandR monitor name such as "DP-1"; empty for the primary one) fps times a second.