Documentation ¶
Index ¶
- Variables
- type Static
- type Transition
- type Wallpaper
- func (stw *Wallpaper) AddStatic(at time.Time, filename string)
- func (stw *Wallpaper) AddTransition(from, upto time.Time, fromFilename, toFilename, transitionType string)
- func (stw *Wallpaper) EventLoop(verbose bool, setWallpaperFunc func(string) error, tempImageFilename string) error
- func (stw *Wallpaper) NextEvent(et time.Time) (interface{}, time.Time, error)
- func (stw *Wallpaper) PrevEvent(et time.Time) (interface{}, time.Time, error)
- func (stw *Wallpaper) SetInitialWallpaper(verbose bool, setWallpaperFunc func(string) error, tempImageFilename string) error
- func (stw *Wallpaper) String() string
- func (stw *Wallpaper) UntilNext(et time.Time) (time.Duration, time.Time)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLoopTime = 30 * time.Second
Functions ¶
This section is empty.
Types ¶
type Transition ¶
type Transition struct { From time.Time UpTo time.Time FromFilename string ToFilename string Type string }
func (*Transition) Duration ¶
func (t *Transition) Duration() time.Duration
func (*Transition) String ¶
func (t *Transition) String(format string) string
type Wallpaper ¶
type Wallpaper struct { STWVersion string Name string Format string Path string // not part of the file data, but handy when parsing Statics []*Static Transitions []*Transition LoopWait time.Duration // how long the main event loop should sleep }
func DataToSimple ¶
DataToSimple converts from the contents of a Simple Timed Wallpaper file to a Wallpaper structs. The given path is used in the error messages and for setting stw.Path.
func NewWallpaper ¶
func ParseSTW ¶
Example ¶
stw, err := ParseSTW("testdata/adwaita-timed2.stw") if err != nil { panic(err) } fmt.Println(stw.Name) stw, err = ParseSTW("testdata/comments.stw") if err != nil { panic(err) } fmt.Println(stw.Name)
Output: adwaita-timed comments
func (*Wallpaper) AddTransition ¶
func (*Wallpaper) EventLoop ¶
func (stw *Wallpaper) EventLoop(verbose bool, setWallpaperFunc func(string) error, tempImageFilename string) error
EventLoop will start the event loop for this Simple Timed Wallpaper
func (*Wallpaper) NextEvent ¶
NextEvent finds the next event, given a timestamp. Returns an interface{} that is either a static or transition event.
func (*Wallpaper) PrevEvent ¶
PrevEvent finds the previous event, given a timestamp. Returns an interface{} that is either a static or transition event.
func (*Wallpaper) SetInitialWallpaper ¶
func (stw *Wallpaper) SetInitialWallpaper(verbose bool, setWallpaperFunc func(string) error, tempImageFilename string) error
SetInitialWallpaper will set the first wallpaper, before starting the event loop
Click to show internal directories.
Click to hide internal directories.