launcher

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 30 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 launcher is the launcher surface (crates/lys-shell/src/ shell/launcher): a layer-shell overlay per `lys-shell launcher` session, hosting the service/launcher engine. Sessions arrive over the launcher socket; the engine runs on its own goroutine and this package only renders and forwards input.

Index

Constants

View Source
const EmojiMode = "emoji"

EmojiMode is the mode name that opens the emoji grid rather than a list.

View Source
const SearchMode = "search"

SearchMode is the mode name that opens the search panel rather than a rofi session: `-show search`, or `lys-shell launcher` with no arguments.

View Source
const UnicodeMode = "unicode"

UnicodeMode is the mode name that opens the search panel on every named Unicode character.

View Source
const VaultModeName = "vault"

VaultModeName is the vault mode's name, which Deps.Vault builds.

View Source
const WallpaperMode = "wallpaper"

WallpaperMode is the mode name that opens the wallpaper picker rather than a list.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	// Invoke runs fn on the UI loop (app.Invoke).
	Invoke func(fn func())
	// After runs fn on the UI loop after d; the returned stop cancels.
	After func(d time.Duration, fn func()) (stop func())
	// Config is the live config.
	Config func() *config.Config
	// Open maps the layer surface for one session.
	Open func(cfg app.LayerConfig) (Window, error)
	// Font paints every label; Variants gives the message line and
	// markup rows their bold and italic faces.
	Font     render.Font
	Variants widget.VariantFunc
	// Sheet is the shell's stylesheet (the .launcher-* rules), and
	// SheetPriority its priority, which a session's -font/-style CSS
	// sits above.
	Sheet         *widget.Stylesheet
	SheetPriority int
	// Outputs lists the connected outputs, for launcher.monitor.
	Outputs func() []*app.Output
	// MonitorWidth is the width a percent -width resolves against (the
	// compositor picks the output, so the first one stands in, as the
	// Rust surface's fallback does before it is realized).
	MonitorWidth func() int
	// Clipboard is the history the clipboard mode reads (nil: none).
	Clipboard modes.ClipboardHistory
	// Vault builds the vault mode for a session (nil: no vault mode).
	Vault func() engine.Mode
	// Copy puts calc's result on the clipboard.
	Copy func(text string)
	// Type enters text in the focused window (typetext.Type).
	Type func(text string) error
	// OpenHistory opens the launch history (a test seam).
	OpenHistory func() (*engine.History, error)
	// Search is what the search panel's providers draw on.
	Search func() search.Deps
	// OpenFrecency opens what the search panel has learned.
	OpenFrecency func() (*search.Frecency, error)
	// WatchFiles calls fn on the UI loop when anything under paths changes
	// (app.WatchFiles); the search panel's kept sources load again then.
	// Nil loads them again in every session.
	WatchFiles search.WatchFunc
	// Wallpapers is what the wallpaper picker sets wallpapers through; nil
	// leaves the shell without the picker.
	Wallpapers Wallpapers
	// FocusedOutput is the compositor's focused output, false when it
	// cannot tell.
	FocusedOutput func() (string, bool)
	// Emoji is the emoji table the grid shows (modes.AvailableEmoji).
	Emoji func() []modes.Emoji
	// FireHook runs a -on-* hook (engine.FireHook; a test seam).
	FireHook func(command string, ctx engine.HookContext)
}

Deps are what the shell hands the surface.

type Surface

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

Surface is the launcher (shell/launcher/mod.rs): it serves the launcher socket's sessions on the UI loop.

func New

func New(d Deps) *Surface

New builds the surface over its collaborators.

func (*Surface) ClientGone

func (s *Surface) ClientGone(id uint64)

ClientGone implements launcheripc.Handler: a CLI that went away ends its session if it is still the live one, and its connection is released either way.

func (*Surface) Open

func (s *Surface) Open(sess *launcheripc.Session)

Open implements launcheripc.Handler: the session moves onto the loop.

type Wallpapers added in v0.3.15

type Wallpapers interface {
	// Images lists the pictures the picker offers.
	Images() ([]string, error)
	// Shown is the image monitor shows now, "" for none.
	Shown(monitor string) string
	// Preview shows path on monitor ("" every monitor) without setting it.
	Preview(path, monitor string) error
	// EndPreview shows the set images again.
	EndPreview()
	// Commit sets path on monitor ("" every monitor) and saves it to the
	// config.
	Commit(path, monitor string) error
	// LoadThumbnail is path's thumbnail, made off the loop.
	LoadThumbnail(path string) (image.Image, error)
}

Wallpapers is what the picker shows and sets wallpapers through.

type Window

type Window interface {
	Close()
	SetFocus(w widget.Widget) error
	// SetOpacity fades the surface in the compositor, with the blur behind
	// it; an error is a compositor without the protocol.
	SetOpacity(alpha float64) error
	// Scale is the device scale the surface presents at, num device pixels
	// per denom logical ones; OnScaleChanged hears each change.
	Scale() (num, denom int)
	OnScaleChanged(fn func(num, denom int)) (cancel func())
}

Window is the launcher's layer surface (*app.LayerWindow).

Jump to

Keyboard shortcuts

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