Lua Documentation

spawn

Description

Spawns the programs as if it was typed into the shell.

Does not update the global program spawn list.

Parameters

bin - The program to run. Can be an absolute path or a command to run. args - The arguments (as a string) to pass to the program.

Examples

-- Spawns a terminal on startup
util.program.spawn("weston-terminal")

spawn_once

Description

Returns a function that spawns a program once. The function takes no arguments and returns no value.

Does not update the global program spawn list.

Used primarily for key mapping

Parameters

bin - The program to run. Can be an absolute path or a command to run. args - The arguments (as a string) to pass to the program.

Return Value

callback - The callback that, when triggered, will spawn the program.

Examples

-- Spawns a terminal when you press <mod>+s
spawn_key = key({ mod }, "s", util.program.spawn("weston-terminal"))
way_cooler.register_key(spawn_key)
-- Convoluted way to spawn a program at startup
func = util.program.spawn_once("weston-terminal")
func()

spawn_at_startup

Description

Registers the program to spawn at startup and every time Way Cooler restarts.

Parameters

bin - The program to run. Can be an absolute path or a command to run. args - The arguments (as a string) to pass to the program.

Examples

# Spawns the standard background program using an all white background.
# Everytime Way Cooler is restarted, this program is killed and re-executed.
util.program.spawn_at_startup("way-cooler-bg", "--color " .. 0xFFFFFF)

spawn_startup_programs

Description

Spawns the programs registered to start at startup.

terminate_startup_programs

Description

Stops the startup programs. Does not remove them from the global list.

This means another call to spawn_startup_programs will respawn the programs killed by this function.

restart_startup_programs

Description

Stops the startup programs and then immediately starts them again. Useful for the “restart” command.

Does not remove them from the global list.