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 ¶
- func Bootstrap(svc *wallpaper.Service, cfg config.WallpaperConfig)
- type OutputWatcher
- type Picker
- func (p *Picker) Commit(path, monitor string, saved func(error)) error
- func (p *Picker) EndPreview()
- func (p *Picker) Images() ([]string, error)
- func (p *Picker) LoadThumbnail(path string) (image.Image, error)
- func (p *Picker) Preview(path, monitor string) error
- func (p *Picker) Shown(monitor string) string
- type Shell
- func (s *Shell) AddOutput(out *app.Output)
- func (s *Shell) AwaitFirstFrame(out *app.Output, done func()) (cancel func())
- func (s *Shell) NewPicker(cfg func() *config.Config, ...) *Picker
- func (s *Shell) RemoveOutput(out *app.Output)
- func (s *Shell) Service() *wallpaper.Service
- func (s *Shell) SetConfig(cfg *config.Config)
- type Transition
- type TransitionKind
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 ¶
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) LoadThumbnail ¶
LoadThumbnail is path's large thumbnail, from the thumbnail cache or made and saved there.
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 ¶
AddOutput registers an output once its connector name is known and applies the config a hotplugged monitor gets.
func (*Shell) AwaitFirstFrame ¶
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 ¶
RemoveOutput drops an unplugged output from the service.
func (*Shell) Service ¶
Service exposes the running service (theme providers subscribe to its Extracted ticks).
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.