spawn

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package spawn runs the shell commands the config names (click actions, power commands): process.rs's run_if_set and spawn_quiet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detached added in v0.2.0

func Detached(cmd *exec.Cmd, name string) error

Detached starts cmd with no stdio in a session and a systemd scope of its own, named for name, and reaps it in the background. The scope is what lets it outlive the shell: restarting the shell's unit stops every process in its cgroup, so an app the shell launched must not stay there.

func Owned added in v0.2.0

func Owned(ctx context.Context, command string) *exec.Cmd

Owned is `sh -c command` bound to ctx as a whole: it runs in a process group of its own, and ctx's end signals that group, so the script's children stop with it. exec.CommandContext alone kills only sh, and a watch script's pipeline outlived every bar rebuild.

func Quiet

func Quiet(cmd string) error

Quiet runs cmd through sh -c without waiting, in a session and a scope of its own (Detached): stdout discarded, and a failure logged with its exit code and stderr once it exits, so the child is always reaped. The returned error is a failure to start; how the command ends is only logged. A blank command runs nothing.

func ScopeName added in v0.2.0

func ScopeName(name string, pid int) string

ScopeName is the unit a launched process runs in: app-lys\x2dshell-<name>-<pid>.scope, name reduced to its program and escaped as systemd-escape does.

func Scoped added in v0.2.0

func Scoped(cmd *exec.Cmd, name string) error

Scoped starts cmd in a session of its own and moves it into its own scope, for the caller to wait on; the error is a failure to start. Without a systemd user manager there is no unit cgroup to leave, so it stays where it is; a manager that refuses the scope is logged, the process already running.

Types

This section is empty.

Jump to

Keyboard shortcuts

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