Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // ActiveWindowTitle returns the currently active window's title. ActiveWindowTitle() string // DetectWindowTitleChanges blocks and starts detecting changes in window // titles. When a change is detected, the onChange function is called and // when a non-fatal error occurs the onError function is called for that // error. DetectWindowTitleChanges(onChange func(), onError func(error)) error }
API defines the functions necessary to monitor window activity.
type X11 ¶
type X11 struct { // This is the underlying X11 connection. XConnection *xgb.Conn // This is the root window. RootWindow xproto.Window // The value of this atom should be the currently active window identifier. // NOTE: Sometimes there is no currently active window. ActiveWindowAtom xproto.Atom // This is the canonical window title atom. When the value for it is // retrieved, it should always return the current real window title. WindowNameAtom xproto.Atom // This is a common window title atom. Any changes that occur for it may // indicate the title has been updated. WindowName2Atom xproto.Atom // This is another common window title atom. Any changes that occur for it // may indicate the title has been updated. WindowName3Atom xproto.Atom }
X11 creates and manages the currently active X11 connection.
func NewX11 ¶
NewX11 starts up a new connection to an X11 display server, interning all necessary atoms up front and setting up the root window.
func (X11) ActiveWindowTitle ¶
ActiveWindowTitle returns the currently active window title or an empty string if one is not available.
func (X11) DetectWindowTitleChanges ¶
DetectWindowTitleChanges blocks and starts detecting changes in window titles. When a change is detected, the onChange function is called and when a non-fatal error occurs the onError function is called for that error.
Click to show internal directories.
Click to hide internal directories.