shellapp

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package shellapp runs a quickshell-based desktop app: it supervises the UI process, daemonizes, tracks instances via PID files, resolves the shell config dir, and talks to a running instance over dankgo/ipc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func New

func New(cfg Config) *App

func (*App) CallOrLaunch

func (a *App) CallOrLaunch(method string, params map[string]any) error

CallOrLaunch sends method to a running instance, cold-starting the daemon when none answers. With params it retries until the fresh instance's socket is up, so the request survives the cold start.

func (*App) CallUI

func (a *App) CallUI(method string, params map[string]any) error

func (*App) Commands

func (a *App) Commands() []*cobra.Command

Commands returns the standard shell lifecycle commands: run, restart, kill, and the hidden restart-detached helper.

func (*App) ConfigPath

func (a *App) ConfigPath() string

func (*App) CustomConfigVar

func (a *App) CustomConfigVar() *string

func (*App) Kill

func (a *App) Kill()

func (*App) PIDs

func (a *App) PIDs() []int

PIDs returns the live UI child PIDs and their supervising parents, reaping PID files whose processes are gone.

func (*App) ResolveConfig

func (a *App) ResolveConfig(_ *cobra.Command, _ []string) error

ResolveConfig resolves the quickshell config dir. Explicit overrides win (custom path, then <PREFIX>_SHELL_DIR), then the path a running instance is using, then the UI embedded in the binary. There is no implicit filesystem search.

func (*App) Restart

func (a *App) Restart()

func (*App) RestartDetached

func (a *App) RestartDetached(targetPIDStr string)

func (*App) RunDaemon

func (a *App) RunDaemon(session bool) error

func (*App) RunInteractive

func (a *App) RunInteractive(session bool) error

func (*App) SessionPID

func (a *App) SessionPID() (int, bool)

SessionPID returns the UI child PID for the current WAYLAND_DISPLAY session, falling back to the first live instance.

func (*App) SessionSocketPath

func (a *App) SessionSocketPath() (string, bool)

SessionSocketPath returns the backend socket of the instance supervising the current WAYLAND_DISPLAY session.

type Backend

type Backend interface {
	SocketPath() string
	Close()
}

type Config

type Config struct {
	ID         string // xdg/socket/pidfile identity, e.g. "dankcal"
	EnvPrefix  string // default: upper(ID); drives <P>_SOCKET, <P>_SHELL_DIR, <P>_LOG_*
	QSAppID    string // e.g. "com.danklinux.dankcalendar"
	Version    string
	Embedded   Embedded
	Boot       func(ctx context.Context) (Backend, error)
	PreLaunch  func()
	ExtraEnv   func(configPath string) []string
	OnUIExit   func(exitCode int, uptime time.Duration, stderrTail string)
	ShowMethod string // IPC method `run` calls on a live instance instead of relaunching; empty relaunches

	SessionRestartExitCode int                              // exit code on SIGUSR1 managed restart (defaults to 1)
	TryManagedRestart      func() (handled bool, err error) // optional hook to route restart via service manager
}

type Embedded

type Embedded interface {
	Available() bool
	Extract(baseDir string) (string, error)
	Prune(baseDir, keep string)
}

Directories

Path Synopsis
Package shellfs materializes an embedded UI tree onto the filesystem, since quickshell needs real paths.
Package shellfs materializes an embedded UI tree onto the filesystem, since quickshell needs real paths.

Jump to

Keyboard shortcuts

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