wallpaper

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 23 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 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, watch OutputWatcher) (*Shell, func())

Launch is Start on the session bus, 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 (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. 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) 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