wm

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	XUtil *xgbutil.XUtil
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// tiling window gaps, unfocused/focused window border colors, mod key for all wm actions, window border width, keybinds
	Layouts        map[int][]Layout `koanf:"layouts"`
	Gap            uint32           `koanf:"gaps"`
	Resize         uint32           `koanf:"resize-amount"`
	OuterGap       uint32           `koanf:"outer-gap"`
	StartTiling    bool             `koanf:"default-tiling"`
	BorderUnactive uint32           `koanf:"unactive-border-color"`
	BorderActive   uint32           `koanf:"active-border-color"`
	ModKey         string           `koanf:"mod-key"`
	BorderWidth    uint32           `koanf:"border-width"`
	Keybinds       []Keybind        `koanf:"keybinds"`
	AutoFullscreen bool             `koanf:"auto-fullscreen"`
}

type Keybind

type Keybind struct {
	// keycode, the letter of the key, if shift should be pressed, command (can be empty), role in wm (can be empty)
	Keycode uint32
	Key     string `koanf:"key"`
	Shift   bool   `koanf:"shift"`
	Exec    string `koanf:"exec"`
	Role    string `koanf:"role"`
}

type Layout

type Layout struct {
	Windows []LayoutWindow `koanf:"windows"`
}

a tiling layout of windows

type LayoutWindow

type LayoutWindow struct {
	WidthPercentage  float64 `koanf:"width"`
	HeightPercentage float64 `koanf:"height"`
	XPercentage      float64 `koanf:"x"`
	YPercentage      float64 `koanf:"y"`
}

where a window is on a layout (dynamic by using percentages)

type RLayoutWindow added in v1.0.3

type RLayoutWindow struct {
	Width, Height, X, Y uint16
}

type ResizeLayout added in v1.0.3

type ResizeLayout struct {
	Windows []RLayoutWindow
}

type Space

type Space struct {
	X, Y          int
	Width, Height int
}

an area on the screen

type Window

type Window struct {
	X, Y          int
	Width, Height int
	Fullscreen    bool
	Client        xproto.Window
	// contains filtered or unexported fields
}

basic window struct

type WindowManager

type WindowManager struct {
	// contains filtered or unexported fields
}

the connection, root window, width and height of screen, workspaces, the current workspace index, the current workspace, atoms for EMWH, if the wm is tiling, the space for tiling windows to be, the different tiling layouts, the wm condig, the mod key

func Create

func Create() (*WindowManager, error)

create the X connection and get the root window, create workspaces and create window manager struct

func (*WindowManager) Close

func (wm *WindowManager) Close()

func (*WindowManager) Frame

func (wm *WindowManager) Frame(w xproto.Window, createdBeforeWM bool)

func (*WindowManager) OnConfigureRequest

func (wm *WindowManager) OnConfigureRequest(event xproto.ConfigureRequestEvent)

func (*WindowManager) OnEnterNotify

func (wm *WindowManager) OnEnterNotify(event xproto.EnterNotifyEvent)

func (*WindowManager) OnLeaveNotify

func (wm *WindowManager) OnLeaveNotify(event xproto.LeaveNotifyEvent)

func (*WindowManager) OnMapRequest

func (wm *WindowManager) OnMapRequest(event xproto.MapRequestEvent)

func (*WindowManager) OnUnmapNotify

func (wm *WindowManager) OnUnmapNotify(event xproto.UnmapNotifyEvent)

func (*WindowManager) Run

func (wm *WindowManager) Run()

func (*WindowManager) SendWmDelete

func (wm *WindowManager) SendWmDelete(conn *xgb.Conn, window xproto.Window) error

func (*WindowManager) UnFrame

func (wm *WindowManager) UnFrame(w xproto.Window, unmapped bool)

type Workspace

type Workspace struct {
	// contains filtered or unexported fields
}

a map from client windows to the frame, the reverse of that, window IDs to windows, and if that workspace is tiling or not (incase it needs to update to sync with the main wm)

Jump to

Keyboard shortcuts

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