river

package
v0.0.0-...-56ccd80 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SuperShift        = ModList{Super, Shift}
	SuperAlt          = ModList{Super, Alt}
	SuperAltShift     = ModList{Super, Alt, Shift}
	SuperAltShiftCtrl = ModList{Super, Alt, Shift, Ctrl}
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Runner
}

Client is able to send commands to river.

func DefaultClient

func DefaultClient() Client

DefaultClient returns a client configured with the default runner.

func NewClient

func NewClient(runner Runner) Client

NewClient returns a new river Client.

func (Client) Bind

func (c Client) Bind(mods Mods, cmd string, args ...string) error

Bind creates a new keybinding.

func (Client) BindF

func (c Client) BindF(mods Mods, cmd string, args ...string)

BindF creaets a new binding and fatally logs any error.

func (Client) BindScript

func (c Client) BindScript(mods Mods, script string) error

BindComplex creates a new keybinding that runs a script.

func (Client) BindScriptF

func (c Client) BindScriptF(mods Mods, script string)

BindF creaets a new script binding and fatally logs any error.

type ExecRunner

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

ExecRunner runs river commands by executing them on the system.

func NewExecRunner

func NewExecRunner(opts ...func(*ExecRunner)) ExecRunner

NexExecRunner creates a new ExecRunner, applies the options to it, and then returns it.

func (ExecRunner) Run

func (r ExecRunner) Run(name string, args ...string) error

Run executes the command on the system.

type Mod

type Mod string

Mod is a symbol that represents a single modifier key.

var (
	Super Mod = "Super"
	Shift Mod = "Shift"
	Ctrl  Mod = "Control"
	Alt   Mod = "Alt"
)

func (Mod) Mods

func (m Mod) Mods() string

Mods returns the single modifier key.

type ModList

type ModList []Mod

ModList represents a list of modifier keys pressed at once.

func (ModList) Mods

func (ml ModList) Mods() string

Mods returns the list of mods as a string.

type Mods

type Mods interface {
	// Mods returns the string representation of all mods.
	Mods() string
}

Mods represents a modifier combination.

type Runner

type Runner interface {
	Run(name string, args ...string) error
}

Runner runs river commands.

Jump to

Keyboard shortcuts

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