Files
galahad2lcd/internal/cli/signal.go
T
Maksim Totmin 4c34f0bedc Initial commit: Go driver for the Lian Li Galahad II LCD
Streams H.264 to the Galahad II LCD via USB (gousb) with:
- ffmpeg CLI transcoding (no fragile FFmpeg C-ABI bindings)
- pure-Go Annex-B access-unit splitting
- framerate pacing with graceful shutdown and USB reconnect
- TOML config, cobra CLI, structured slog logging, unit tests
2026-08-19 12:03:54 +07:00

15 lines
360 B
Go

package cli
import (
"context"
"os"
"os/signal"
"syscall"
)
// newSignalContext returns a context that is cancelled on SIGINT or SIGTERM,
// so that Ctrl-C and systemctl stop both trigger a clean shutdown.
func newSignalContext() (context.Context, context.CancelFunc) {
return signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
}