daemon

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package daemon implements the z13ctl long-running daemon: Unix socket server, hardware device management, state persistence, and Armoury Crate button watcher.

Designed as a systemd user service using two units:

  • z13ctl.socket — systemd manages the socket fd (socket activation)
  • z13ctl.service — Type=notify, Restart=on-failure

Can also be run directly for development: z13ctl daemon.

The daemon socket client (Send*, Subscribe, SocketPath) lives in the public api package: github.com/dahui/z13ctl/api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opts Options) error

Run starts the daemon and blocks until ctx is cancelled. It opens HID devices, restores the last-saved state, starts the button watcher, and serves the Unix socket.

Types

type Daemon

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

Daemon holds the runtime state for the long-running z13ctl process.

type Options added in v1.3.1

type Options struct {
	// WatchButton starts the Armoury Crate button watcher (--no-button clears it).
	WatchButton bool
	// SleepRelease hands the fans back to the firmware before sleep, so the EC
	// stops them (--no-sleep-release clears it).
	SleepRelease bool
}

Options configures the daemon. A zero value disables both watchers, so callers state what they want rather than relying on positional bools — Run(ctx, true, false) said nothing about which flag was which.

Jump to

Keyboard shortcuts

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