wallpaper

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT, MIT Imports: 38 Imported by: ? 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 wallpaper renders the wallpaper service natively: one Background layer surface per output, reconciled against the service's per-monitor state, each swapping images with the wallpaper transition. lys-shell is the wallpaper provider; no swww or other tool is involved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(svc *wallpaper.Service, cfg config.WallpaperConfig)

Bootstrap applies the config to freshly registered monitors: the global fit mode, then cycling when a directory is set (else the single image), then the [[wallpaper.monitors]] entries on top. Seeding the fit mode keeps the service, the D-Bus getters, and the pixels in agreement.

Types

type OutputWatcher

type OutputWatcher interface {
	WatchOutputIdentity(fn func(*app.Output)) (stop func())
	WatchOutputs(added, removed func(*app.Output)) (stop func())
}

OutputWatcher is the session's output hotplug feed: the identity of a monitor once its connector name is known, and its removal.

type Picker

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

Picker is what the launcher's wallpaper picker sets wallpapers through: the running service for previews and the live view, and the config for what is kept.

func (*Picker) Commit

func (p *Picker) Commit(path, monitor string, saved func(error)) error

Commit sets path on monitor, or every monitor when monitor is empty, and saves it: the monitor's own entry, or the global image with every entry's image cleared, in one config change whose outcome saved hears. A wallpaper that cannot be set is the error returned, and nothing is saved.

func (*Picker) EndPreview

func (p *Picker) EndPreview()

EndPreview shows the set images again.

func (*Picker) Images

func (p *Picker) Images() ([]string, error)

Images lists the pictures of the picker's directories.

func (*Picker) LoadThumbnail

func (p *Picker) LoadThumbnail(path string) (image.Image, error)

LoadThumbnail is path's large thumbnail, from the thumbnail cache or made and saved there.

func (*Picker) Preview

func (p *Picker) Preview(path, monitor string) error

Preview shows path on monitor ("" every monitor) without setting it.

func (*Picker) Shown

func (p *Picker) Shown(monitor string) string

Shown is the image monitor shows, "" for none.

type Shell

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

Shell owns the wallpaper service and its surfaces. Its methods run on the lys-ui loop goroutine.

func Launch

func Launch(application *app.Application, outputs []*app.Output, cfg *config.Config, conn *dbus.Conn, watch OutputWatcher) (*Shell, func())

Launch is Start on the shell's session connection, following hotplugged outputs through watch. A failure is logged and leaves the shell without wallpapers (nil).

func Start

func Start(application *app.Application, outputs []*app.Output, cfg *config.Config, conn *dbus.Conn) (*Shell, func(), error)

Start builds the service from config, registers the outputs that have a connector name, serves dev.stubbe.lys.Wallpaper1 on conn, and starts the cycling and extraction loops and the surfaces. It fails when the D-Bus name is taken (another shell is running): no wallpaper is drawn then. The returned stop function ends the loops, releases the name, and lets go of the wallpapers once the loop has ended.

func (*Shell) AddOutput

func (s *Shell) AddOutput(out *app.Output)

AddOutput registers an output once its connector name is known and applies the config a hotplugged monitor gets.

func (*Shell) AwaitFirstFrame

func (s *Shell) AwaitFirstFrame(out *app.Output, done func()) (cancel func())

AwaitFirstFrame runs done on the loop once out's wallpaper has painted its first frame, so a surface committed after it lands over the wallpaper: at once when it has, or when out is left with no wallpaper to wait for. cancel drops done unrun.

func (*Shell) NewPicker

func (s *Shell) NewPicker(cfg func() *config.Config, setConfig func(path string, value any, done func(error))) *Picker

NewPicker serves the picker from the shell's service; setConfig queues a config change to apply and save, and hands done its outcome on the UI loop: the error that refused or lost it, or nil once it is saved.

func (*Shell) RemoveOutput

func (s *Shell) RemoveOutput(out *app.Output)

RemoveOutput drops an unplugged output from the service.

func (*Shell) Service

func (s *Shell) Service() *wallpaper.Service

Service exposes the running service (theme providers subscribe to its Extracted ticks).

func (*Shell) SetConfig

func (s *Shell) SetConfig(cfg *config.Config)

SetConfig applies a reloaded config: the extraction settings and the wallpaper changes. Monitors that appear later take their state from the new snapshot, and the next swap plays the new [animations] transition. Call it on the loop goroutine.

type Transition

type Transition struct {
	Kind     TransitionKind
	Duration time.Duration
}

Transition is the kind and its duration.

type TransitionKind

type TransitionKind uint8

TransitionKind is how one wallpaper replaces the previous one.

const (
	TransitionNone TransitionKind = iota
	TransitionCrossfade
	TransitionSlideUp
	TransitionSlideDown
	TransitionSlideLeft
	TransitionSlideRight
)

Transitions. The [animations] types a Stack cannot do (swing, bounce, genie, zoom, rotate, flip) fall back to Crossfade.

Jump to

Keyboard shortcuts

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