sway

package
v0.0.0-...-b4fdbc6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package sway provides functions and structs to communicate with a sway IPC socket according to sway-ipc(7)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPC_command

type IPC_command uint32
const (
	RUN_COMMAND       IPC_command = 0
	GET_WORKSPACES    IPC_command = 1
	SUBSCRIBE         IPC_command = 2
	GET_OUTPUTS       IPC_command = 3
	GET_TREE          IPC_command = 4
	GET_MARKS         IPC_command = 5
	GET_BAR_COFIG     IPC_command = 6
	GET_VERSION       IPC_command = 7
	GET_BINDING_MODES IPC_command = 8
	GET_CONFIG        IPC_command = 9
	SEND_TICK         IPC_command = 10
	// SYNC ommited cause it's only there for i3 compability
	GET_INPUTS IPC_command = 100
	GET_SEATS  IPC_command = 101
)

type Mode

type Mode struct {
	Width   int
	Height  int
	Refresh int
}

func (*Mode) IsEqualTo

func (s *Mode) IsEqualTo(m Mode) bool

type Output

type Output struct {
	Name              string
	Make              string
	Model             string
	Serial            string
	Active            bool
	Primary           bool
	Scale             float64
	Subpixel_hinting  string
	Transform         string
	Current_workspace string
	Modes             []Mode
	Current_mode      *Mode
	Rect              Rectangle
}

func DownOf

func DownOf(o *Output, outputs []Output) *Output

func LeftOf

func LeftOf(o *Output, outputs []Output) *Output

func RightOf

func RightOf(o *Output, outputs []Output) *Output

func UpOf

func UpOf(o *Output, outputs []Output) *Output

func (*Output) IsEqualTo

func (s *Output) IsEqualTo(o Output) bool

type OutputsWithSelected

type OutputsWithSelected struct {
	SelectedOutput *Output
	Outputs        []Output
}

type Rectangle

type Rectangle struct {
	X      int
	Y      int
	Width  int
	Height int
}

type SwayAnswer

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

type SwayConnection

type SwayConnection struct {
	Outputs []Output
	// contains filtered or unexported fields
}

func CreateSwayConnection

func CreateSwayConnection() (SwayConnection, error)

CreateSwayConnection creates the sway connection

func (*SwayConnection) ApplyOutputs

func (s *SwayConnection) ApplyOutputs(o []Output) error

ApplyOutputs applies the Output Array to the sway sock

func (*SwayConnection) CloseConnection

func (s *SwayConnection) CloseConnection()

func (*SwayConnection) GetOutputsFromSocket

func (s *SwayConnection) GetOutputsFromSocket() error

Sets SwayConnection.Outputs to the outputs currently present on the Sway Socket

Jump to

Keyboard shortcuts

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