|
|
|
@ -6,7 +6,6 @@ import (
@@ -6,7 +6,6 @@ import (
|
|
|
|
|
"log" |
|
|
|
|
"net/http" |
|
|
|
|
"os" |
|
|
|
|
"runtime" |
|
|
|
|
|
|
|
|
|
"github.com/reujab/wallpaper" |
|
|
|
|
) |
|
|
|
@ -29,7 +28,7 @@ func main() {
@@ -29,7 +28,7 @@ func main() {
|
|
|
|
|
} |
|
|
|
|
err = wallpaper.SetFromURL(apod.Hdurl) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Fatalf("\nUnable to set wallpaper\n") |
|
|
|
|
log.Fatalf("\nUnable to set wallpaper: %+v\n", err) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
err = wallpaper.SetMode(wallpaper.Center) |
|
|
|
@ -37,11 +36,11 @@ func main() {
@@ -37,11 +36,11 @@ func main() {
|
|
|
|
|
log.Fatalf("\nUnable to set wallpaper mode\n") |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if runtime.GOOS != "windows" { |
|
|
|
|
// https://gist.github.com/mattes/d13e273314c3b3ade33f
|
|
|
|
|
if _, err := os.Stat("/usr/share/backgrounds/spaceface"); !os.IsNotExist(err) { |
|
|
|
|
err = downloadFile("/usr/share/backgrounds/spaceface/lock.jpg", apod.Hdurl) |
|
|
|
|
if err != nil { |
|
|
|
|
log.Fatalf("\nUnable to Download lock.jpg image\n") |
|
|
|
|
log.Fatalf("\nUnable to Download lock.jpg image: %+v\n", err) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|