appstore

package
v1.0.260758 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package appstore is the Start ▸ App Store window: a generic engine that fetches a catalog (index.json) from one or more configured GitHub repos (config.Config.AppSources), lets the user install an entry (runs its install script in a terminal window), and once an entry's Detect check passes, registers its launchers into Start ▸ Programs. No app-specific logic lives here — see https://github.com/RetroCodeRamen/ttypedesk-apps for the catalog format and the first entry (carbonyl "Internet").

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
}

App is the App Store window.

func New

func New(cfg config.Config, onSave func(config.Config)) *App

func (*App) Close

func (a *App) Close() error

func (*App) Draw

func (a *App) Draw(cv *uiapp.Canvas) error

func (*App) Handle

func (a *App) Handle(e uiapp.Event) error

func (*App) Hooks

func (a *App) Hooks() uiapp.Hooks

func (*App) Init

func (a *App) Init(ctx *uiapp.Context) error

func (*App) WantsClose

func (a *App) WantsClose() bool

type DetectSpec

type DetectSpec struct {
	Which string   `json:"which"` // exec.LookPath check, optional
	Paths []string `json:"paths"` // literal file paths ("~" expanded), optional
}

DetectSpec describes how to check whether an entry is already installed. Which and Paths are independent checks — either matching counts as installed.

type InstallSpec

type InstallSpec struct {
	Script string `json:"script"` // path relative to the repo root
}

InstallSpec points at the install script within the source repo.

type RegisterEntry

type RegisterEntry struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Command string `json:"command"`
	Icon    string `json:"icon"`
	Menu    string `json:"menu"`
	// SetRole, if set (e.g. "filemgr"), also points cfg.Roles.<Role> at
	// this program once registered — the desktop's default for that role
	// (Start menu, desktop icons, "open this folder") switches to it
	// instead of just adding an extra Programs entry.
	SetRole string `json:"set_role,omitempty"`
	// Bridge, if true, launches Command through the GUI-TUI Bridge (a
	// real X11 app) instead of as a shell command in a PTY — for
	// catalog entries that are themselves X11 GUI programs.
	Bridge bool `json:"bridge,omitempty"`
	// ExtApp, if true, launches Command as an out-of-process App SDK
	// binary (pkg/extapprun; see docs/extapp.md) instead of as a shell
	// command in a PTY — for catalog entries that are themselves a
	// TTYPE Desk app built to run standalone (e.g. Matrix Chat).
	// Mutually exclusive with Bridge in practice, though nothing enforces
	// that — an entry wouldn't set both.
	ExtApp bool `json:"ext_app,omitempty"`
}

RegisterEntry is a Start-menu launcher to add once an app is detected as installed. Shape mirrors config.Program.

type RemoteEntry

type RemoteEntry struct {
	ID          string          `json:"id"`
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Icon        string          `json:"icon"`
	Detect      DetectSpec      `json:"detect"`
	Install     InstallSpec     `json:"install"`
	Register    []RegisterEntry `json:"register"`
}

RemoteEntry is one installable app, as described by a source repo's index.json. See https://github.com/RetroCodeRamen/ttypedesk-apps for the format and an example.

Jump to

Keyboard shortcuts

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