Documentation ¶
Index ¶
Constants ¶
const DistributionInterval = 15 * time.Second
DistributionInterval is the amount of time between each automatic redistribution. These will happen periodically, regardless of any messages being sent down the message channel.
const OverlayDuration = 500 * time.Millisecond
OverlayDuration specifies how long the overlay will stay on the screen for.
const SwitchTimeout = time.Second
SwitchTimeout is the amount of time the switcher will wait for outbound message acknowledgement.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DistributorThread ¶
DistributorThread is a long-running process that handles re-distributing workspaces so that i3x3 remains functional. Whenever an X event occurs, or also periodically, workspaces will be placed on the output that i3x3 expects them to be on.
func NewDistributorThread ¶
func NewDistributorThread(logger log15.Logger, msgCh chan struct{}) *DistributorThread
NewDistributorThread creates a new workspace distributor thread.
func (*DistributorThread) Start ¶
func (t *DistributorThread) Start() error
Start attempts to start the distributor thread.
func (*DistributorThread) Stop ¶
func (t *DistributorThread) Stop() error
Stop attempts to stop the distributor thread.
type OverlayThread ¶
OverlayThread is a long-running process than handles showing the GTK-based overlay.
func NewOverlayThread ¶
func NewOverlayThread(logger log15.Logger, msgCh <-chan SwitchMessage) *OverlayThread
NewOverlayThread creates a new workspace overlay thread.
func (*OverlayThread) Start ¶
func (t *OverlayThread) Start() error
Start attempts to start the overlay thread.
func (*OverlayThread) Stop ¶
func (t *OverlayThread) Stop() error
Stop attempts to stop the overlay thread.
type SwitchMessage ¶
type SwitchMessage struct { // Context is a context used to cancel downstream events. It should be set with a timeout. Context context.Context // ResponseCh is a channel to send a response down. The response may simply be nil, indicating // success. If an error is sent, it may bubble up and be sent to the client. ResponseCh chan<- error // Environment is a grid environment (containing things about the current state of the grid). Environment grid.Environment // Target is the workspace we're going to switch to, if we're going to switch workspaces. Target float64 }
SwitchResult is the result of an attempt to switch workspaces.
func NewSwitchMessage ¶
func NewSwitchMessage(ctx context.Context, env grid.Environment, target float64) (SwitchMessage, chan error)
NewSwitchMessage creates a new switch message, used to notify some consumer.
type SwitchThread ¶
SwitchThread is the long-running workspace switcher. It will process one message at a time.
func NewSwitchThread ¶
func NewSwitchThread(logger log15.Logger, msgCh <-chan rpc.Message, outCh chan<- SwitchMessage) *SwitchThread
NewSwitchThread creates a new workspace switcher thread.
func (*SwitchThread) Start ¶
func (t *SwitchThread) Start() error
Start a loop that will loop until canceled. It waits for messages to come in, handles them, and sends a response back to the message sender.
func (*SwitchThread) Stop ¶
func (t *SwitchThread) Stop() error
Stop attempts to gracefully stop the switcher's loop.