wmutils

package
v0.0.0-...-196a8a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2018 License: ISC Imports: 3 Imported by: 0

Documentation

Overview

Package wmutils provides wrappers around https://github.com/wmutils

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(wid WindowID) (bool, error)

Exists returns true if there is a window with the given ID, false otherwise. Wraps wattr.

func Focus

func Focus(wid WindowID) error

Focus sets the keyboard input focus to the window with the given ID if it exists and is viewable. Wraps wtf.

func GetAttributes

func GetAttributes(wid WindowID) (Position, Size, error)

GetAttributes returns the size and position of the window with the given ID. Wraps wattr xywh.

func IsIgnored

func IsIgnored(wid WindowID) (bool, error)

IsIgnored returns true if and only if the window with the given ID has the override_redirect attribute set. Wraps wattr o.

func Kill

func Kill(wid WindowID) error

Kills the window with the given ID. Wraps killw -p.

func List

func List() (map[WindowID]bool, error)

List returns the IDs of the child windows of the root (excluding invisible or ignored windows). Wraps lsw.

func Map

func Map(wid WindowID) error

Map (show) the window with the given ID. Wraps mapw -m.

func Raise

func Raise(wid WindowID) error

Raises the window with the given ID to the top of the stacking order. Wraps chwso.

func SetBorderColour

func SetBorderColour(wid WindowID, colour Colour) error

SetBorderColour sets the colour of the border for the window with the given ID. Wraps chwb -c.

func SetBorderWidth

func SetBorderWidth(wid WindowID, width Pixels) error

SetBorderWidth sets the width of the border for the window with the given ID. Wraps chwb -s.

func Teleport

func Teleport(wid WindowID, pos Position, size Size) error

Teleports the window with given ID to the given position, and resizes it to the given size. Wraps wtp.

func Toggle

func Toggle(wid WindowID) error

Toggle the visibility of the window with the given ID. Wraps mapw -t.

func Unmap

func Unmap(wid WindowID) error

Unmap (hide) the window with the given ID. Wraps mapw -u.

func WatchEvents

func WatchEvents() <-chan Event

this doesn't do any cleanup yet...

Types

type Colour

type Colour uint

func (Colour) String

func (colour Colour) String() string

type Event

type Event struct {
	Type EventType
	WID  WindowID
}

type EventType

type EventType uint
const (
	CreateNotifyEvent EventType = 16 + iota
	DestroyNotifyEvent
	UnmapNotifyEvent
	MapNotifyEvent
)

type Pixels

type Pixels int

type Position

type Position struct {
	X, Y Pixels
}

func (Position) Offset

func (p Position) Offset(s Size) Position

type Size

type Size struct {
	W, H Pixels
}

func (Size) Add

func (a Size) Add(b Size) Size

func (Size) Scale

func (a Size) Scale(k Pixels) Size

type WindowID

type WindowID uint

func Focussed

func Focussed() (WindowID, error)

Focussed returns the WindowID of the currently focussed window. Wraps pfw.

func Root

func Root() (WindowID, error)

Root gets the window ID of the root window. Wraps lsw -r.

func (WindowID) String

func (wid WindowID) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL