Documentation
¶
Index ¶
- func FindWindowByTitleStandalone(substring string) (uint32, error)
- func FocusWindowStandalone(windowID uint32) error
- func GetCurrentDesktopStandalone() (int, error)
- func SetWindowDesktopStandalone(windowID uint32, desktop int) error
- type Connection
- func (c *Connection) Close()
- func (c *Connection) EventLoop()
- func (c *Connection) FindWindowByTitle(substring string) (uint32, error)
- func (c *Connection) FocusWindow(windowID uint32) error
- func (c *Connection) GetActiveMonitor() (*Monitor, error)
- func (c *Connection) GetActiveWindow() (xproto.Window, error)
- func (c *Connection) GetCurrentDesktop() (int, error)
- func (c *Connection) GetDesktopCount() (int, error)
- func (c *Connection) GetFrameExtents(windowID xproto.Window) (left, right, top, bottom int, err error)
- func (c *Connection) GetMonitors() ([]Monitor, error)
- func (c *Connection) GetWindowDesktop(windowID uint32) (int, error)
- func (c *Connection) IsNormalWindow(windowID xproto.Window) bool
- func (c *Connection) MoveResizeWindow(windowID xproto.Window, x, y, width, height int) error
- func (c *Connection) SetWindowDesktop(windowID uint32, desktop int) error
- type Monitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindWindowByTitleStandalone ¶
FindWindowByTitleStandalone searches for a window by title substring using a new temporary X11 connection.
func FocusWindowStandalone ¶
FocusWindowStandalone activates and raises a window using a new temporary X11 connection.
func GetCurrentDesktopStandalone ¶
GetCurrentDesktopStandalone returns the current virtual desktop number using a new X11 connection. This is useful when you don't have an existing connection available.
func SetWindowDesktopStandalone ¶
SetWindowDesktopStandalone moves a window to the specified virtual desktop using a new temporary X11 connection.
Types ¶
type Connection ¶
Connection manages the X11 connection and core X resources
func NewConnection ¶
func NewConnection() (*Connection, error)
NewConnection establishes a connection to the X11 server and initializes required extensions
func (*Connection) Close ¶
func (c *Connection) Close()
Close cleanly disconnects from the X11 server
func (*Connection) EventLoop ¶
func (c *Connection) EventLoop()
EventLoop starts the main X11 event loop (blocking)
func (*Connection) FindWindowByTitle ¶
func (c *Connection) FindWindowByTitle(substring string) (uint32, error)
FindWindowByTitle searches the EWMH client list for a window whose _NET_WM_NAME contains the given substring. Returns the first match.
func (*Connection) FocusWindow ¶
func (c *Connection) FocusWindow(windowID uint32) error
FocusWindow activates and raises a window using _NET_ACTIVE_WINDOW. Sends a client message to the root window per EWMH spec. We build the message manually (same as SetWindowDesktop) because the xgbutil ewmh helpers panic on this library version.
func (*Connection) GetActiveMonitor ¶
func (c *Connection) GetActiveMonitor() (*Monitor, error)
GetActiveMonitor returns the monitor containing the currently focused window The returned monitor geometry is adjusted to respect the work area (excluding panels/docks)
func (*Connection) GetActiveWindow ¶
func (c *Connection) GetActiveWindow() (xproto.Window, error)
func (*Connection) GetCurrentDesktop ¶
func (c *Connection) GetCurrentDesktop() (int, error)
GetCurrentDesktop returns the current virtual desktop number (0-indexed). Uses _NET_CURRENT_DESKTOP atom. Returns 0 with an error if detection fails.
func (*Connection) GetDesktopCount ¶
func (c *Connection) GetDesktopCount() (int, error)
GetDesktopCount returns the number of virtual desktops.
func (*Connection) GetFrameExtents ¶
func (c *Connection) GetFrameExtents(windowID xproto.Window) (left, right, top, bottom int, err error)
GetFrameExtents returns the window decoration sizes (if available)
func (*Connection) GetMonitors ¶
func (c *Connection) GetMonitors() ([]Monitor, error)
GetMonitors retrieves all active monitors using XRandR
func (*Connection) GetWindowDesktop ¶
func (c *Connection) GetWindowDesktop(windowID uint32) (int, error)
GetWindowDesktop returns the desktop number a window is on. Uses _NET_WM_DESKTOP atom. Returns -1 for "sticky" windows (visible on all desktops). Returns 0 with an error if detection fails.
func (*Connection) IsNormalWindow ¶
func (c *Connection) IsNormalWindow(windowID xproto.Window) bool
IsNormalWindow checks if a window is a normal application window
func (*Connection) MoveResizeWindow ¶
func (c *Connection) MoveResizeWindow(windowID xproto.Window, x, y, width, height int) error
MoveResizeWindow moves and resizes a window to the specified geometry
func (*Connection) SetWindowDesktop ¶
func (c *Connection) SetWindowDesktop(windowID uint32, desktop int) error
SetWindowDesktop moves a window to the specified virtual desktop. Sends a _NET_WM_DESKTOP client message to the root window per EWMH spec. We build the message manually because the xgbutil ewmh.WmDesktopReq helper panics on this library version (uint vs int type assertion).