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 ¶
- type App
- func (a *App) CallOrLaunch(method string, params map[string]any) error
- func (a *App) CallUI(method string, params map[string]any) error
- func (a *App) Commands() []*cobra.Command
- func (a *App) ConfigPath() string
- func (a *App) CustomConfigVar() *string
- func (a *App) Kill()
- func (a *App) PIDs() []int
- func (a *App) ResolveConfig(_ *cobra.Command, _ []string) error
- func (a *App) Restart()
- func (a *App) RestartDetached(targetPIDStr string)
- func (a *App) RunDaemon(session bool) error
- func (a *App) RunInteractive(session bool) error
- func (a *App) SessionPID() (int, bool)
- func (a *App) SessionSocketPath() (string, bool)
- type Backend
- type Config
- type Embedded
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 (*App) CallOrLaunch ¶
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) Commands ¶
Commands returns the standard shell lifecycle commands: run, restart, kill, and the hidden restart-detached helper.
func (*App) ConfigPath ¶
func (*App) CustomConfigVar ¶
func (*App) PIDs ¶
PIDs returns the live UI child PIDs and their supervising parents, reaping PID files whose processes are gone.
func (*App) ResolveConfig ¶
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) RestartDetached ¶
func (*App) RunInteractive ¶
func (*App) SessionPID ¶
SessionPID returns the UI child PID for the current WAYLAND_DISPLAY session, falling back to the first live instance.
func (*App) SessionSocketPath ¶
SessionSocketPath returns the backend socket of the instance supervising the current WAYLAND_DISPLAY session.
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
}