systemd

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package systemd provides a TUI component that lists, inspects, and manages systemd --user services whose names start with "pcloud-sync-".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionsDialog added in v1.3.0

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

ActionsDialog presents an action menu for a selected systemd unit.

func NewActionsDialog added in v1.3.0

func NewActionsDialog(unit Unit, width, height int) ActionsDialog

NewActionsDialog creates an action picker for the given unit.

func (ActionsDialog) Init added in v1.3.0

func (m ActionsDialog) Init() tea.Cmd

func (ActionsDialog) Update added in v1.3.0

func (m ActionsDialog) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ActionsDialog) View added in v1.3.0

func (m ActionsDialog) View() tea.View

type LogsDialog

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

LogsDialog is a tea.Model that renders journal output for a systemd unit in a scrollable viewport. It is shown via msgs.ShowDialogMsg and closes with msgs.CloseDialogMsg when the user presses q or esc.

func NewLogsDialog

func NewLogsDialog(unit string, width, height int) LogsDialog

NewLogsDialog builds a LogsDialog for the given unit name. width and height are the current terminal dimensions.

func (LogsDialog) Init

func (m LogsDialog) Init() tea.Cmd

func (LogsDialog) Update

func (m LogsDialog) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (LogsDialog) View

func (m LogsDialog) View() tea.View

type Model

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

Model is the systemd daemon manager TUI component. It satisfies the same component interface as filebrowser.Model: Init/Update/(View string), not a full tea.Model.

func New

func New(width, height int) Model

New constructs a Model that will load units on Init.

func (Model) Init

func (m Model) Init() tea.Cmd

Init kicks off the initial unit list load.

func (Model) SetSize

func (m Model) SetSize(w, h int) Model

SetSize updates the component dimensions and returns the updated model.

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

Update handles all messages for the systemd component.

func (Model) View

func (m Model) View() string

View renders the systemd manager component as a plain string.

type RemoveDialog added in v1.3.0

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

RemoveDialog asks the user to confirm, then stops, disables, and deletes the systemd unit file for the selected sync daemon.

func NewRemoveDialog added in v1.3.0

func NewRemoveDialog(unit Unit, width, height int) RemoveDialog

NewRemoveDialog creates a remove confirmation dialog for the given unit.

func (RemoveDialog) Init added in v1.3.0

func (m RemoveDialog) Init() tea.Cmd

func (RemoveDialog) Update added in v1.3.0

func (m RemoveDialog) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (RemoveDialog) View added in v1.3.0

func (m RemoveDialog) View() tea.View

type Unit

type Unit struct {
	Name         string // full unit name, e.g. "pcloud-sync-Music.service"
	ActiveState  string // "active", "inactive", "failed", …
	EnabledState string // "enabled", "disabled", "static", …
	Mode         string // sync direction: "down" or "up"
}

Unit represents a single pcloud-sync systemd user service.

func (Unit) ShortName

func (u Unit) ShortName() string

ShortName strips the common prefix and suffix for compact display.

Jump to

Keyboard shortcuts

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