|
|
@ -42,11 +42,13 @@ func init() { |
|
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
func main() { |
|
|
|
flag.Parse() |
|
|
|
flag.Parse() |
|
|
|
|
|
|
|
background, err := wallpaper.Get() |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
log.Panicln(err) |
|
|
|
|
|
|
|
} |
|
|
|
bounds := screenshot.GetDisplayBounds(0) |
|
|
|
bounds := screenshot.GetDisplayBounds(0) |
|
|
|
|
|
|
|
|
|
|
|
var img image.Image |
|
|
|
var img image.Image |
|
|
|
var err error |
|
|
|
|
|
|
|
if useRandom { |
|
|
|
if useRandom { |
|
|
|
img, err = loadRandomUnsplashImage(bounds.Dx(), bounds.Dy()) |
|
|
|
img, err = loadRandomUnsplashImage(bounds.Dx(), bounds.Dy()) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -81,10 +83,6 @@ func main() { |
|
|
|
log.Panicln(err) |
|
|
|
log.Panicln(err) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
background, err := wallpaper.Get() |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
log.Panicln(err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
img, err = loadImage(background) |
|
|
|
img, err = loadImage(background) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Println(background) |
|
|
|
log.Println(background) |
|
|
|