settingspage

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package settingspage is the contract between lys-settings and the programs that open it: its command line, and the page list it prints so a launcher can offer its pages without linking the app.

Index

Constants

View Source
const (
	// Program is the settings app's executable.
	Program = "lys-settings"
	// PageFlag opens the app on a page, by ID.
	PageFlag = "--page"
	// ListFlag prints the pages with Encode and exits.
	ListFlag = "--list-pages"
)

Variables

View Source
var ErrNotInstalled = errors.New("settingspage: lys-settings is not installed")

ErrNotInstalled is the app missing from the path, which is a choice and not a failure: lys-settings is a package of its own.

Functions

func Encode

func Encode(pages []Page) ([]byte, error)

Encode is the list as ListFlag prints it.

func NewLister

func NewLister() func(context.Context) ([]Page, error)

NewLister is List for a long-lived process that asks every time its launcher opens: the pages of an installed app do not change, so the first list is kept. An app that is missing or failing is asked again.

Types

type Page

type Page struct {
	ID    string `json:"id"`
	Title string `json:"title"`
	Icon  string `json:"icon"`
}

Page is one page of the app, its title in the desktop's language.

func Decode

func Decode(data []byte) ([]Page, error)

Decode reads what ListFlag printed; a page without an ID, a title or a unique ID is an error, so no launcher offers a row that cannot open.

func List

func List(ctx context.Context) ([]Page, error)

List asks the installed app for its pages.

func (Page) Argv

func (p Page) Argv() []string

Argv opens the app on a page.

Jump to

Keyboard shortcuts

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