wallpaper

package
v0.3.24 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 38 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 wallpaper renders the wallpaper service natively (crates/lys-shell/src/shell/wallpaper, bootstrap/wallpaper.rs, and the hotplug half of watchers/wallpaper.rs): 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.

The Rust bootstrap leaves the service fit at fill and has the surfaces read fit-mode from config instead; seeding it here 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 added in v0.3.15

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 added in v0.3.15

func (p *Picker) Commit(path, monitor string) 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.

func (*Picker) EndPreview added in v0.3.15

func (p *Picker) EndPreview()

EndPreview shows the set images again.

func (*Picker) Images added in v0.3.15

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

Images lists the pictures of the picker's directories.

func (*Picker) LoadThumbnail added in v0.3.15

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 added in v0.3.15

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

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

func (*Picker) Shown added in v0.3.15

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, firstFrame func()) (*Shell, func())

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

func Start

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

Start builds the service from config (build_wallpaper_service), 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 like the Rust service init when the D-Bus name is taken (another shell is running): no wallpaper is drawn then. firstFrame runs on the loop once the outputs show a wallpaper, or firstFrameLimit gave up waiting for them. 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 (spawn_hotplug_watcher).

func (*Shell) NewPicker added in v0.3.15

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

NewPicker serves the picker from the shell's service; setConfig queues a config change to apply and save.

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 (color_extractor.rs) and the wallpaper changes (watchers/ wallpaper.rs). 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: the gtk::Stack transitions the Rust surface flips between its two pictures (stack_transition).

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, as in Rust.

Jump to

Keyboard shortcuts

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