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, firstFrame func()) (*Shell, func())
Launch is Start on the session bus, 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 ¶
AddOutput registers an output once its connector name is known and applies the config a hotplugged monitor gets (spawn_hotplug_watcher).
func (*Shell) RemoveOutput ¶
RemoveOutput drops an unplugged output from the service.
func (*Shell) Service ¶
Service exposes the running service (theme providers subscribe to its Extracted ticks).
func (*Shell) SetConfig ¶
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.