settingspage

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 8 Imported by: 1 module, 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"
	// SettingFlag opens the app on the page holding a setting, with that
	// setting focused, by path.
	SettingFlag = "--setting"
)
View Source
const PrivacyID = "privacy"

PrivacyID is the Privacy page: what apps were granted through the portal, each grant with a revoke control, and the screen-share reminder. The portal's reminder opens it.

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"`
	Settings []Setting `json:"settings,omitempty"`
}

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.

type Setting

type Setting struct {
	Path     string   `json:"path"`
	Title    string   `json:"title"`
	Keywords []string `json:"keywords,omitempty"`
}

Setting is one setting of a page: its path, its title and the words a search should find it by, in the desktop's language.

func (Setting) Argv

func (s Setting) Argv() []string

Argv opens the app on the setting.

Jump to

Keyboard shortcuts

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